[PHP-DB] cross tab with mssql

2001-09-20 Thread Sommai Fongnamthip

Hi,
I was used MS Access to make cross tab query with MS SQL.  How could I do 
this with PHP?  I was used syntax of MySQL but It did not work.

Thank you,
SF

This is an example data:
Customer#Bill date  Bill amount
---
A12345   21/9/20011000
B56789   21/9/20011000
A12345   22/9/20011000
A12345   23/9/20011000
B56789   23/9/20011000

This is the result I need.
Customer#21/9/2001  22/9/2001 23/9/2001
---
A123451000   1000  1000
B567891000 1000  


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Searching/keywords

2001-09-20 Thread Jason G.

Just an idea...

You could do a str_replace(), replacing " max " with
 max 

You may need to use a reg-exp replace function to determine where actual 
words are like max, vs. substrings like maximus.

see http://www.php.net/manual/en/function.str-replace.php for more info...

-Jason Garber
Lead Programmer - pulseaday.com



At 12:25 AM 9/21/2001 +0100, Matt C wrote:
>I have summaries of episodes stored in a database. How on earth do I go 
>about highlighting keywords? I mean I have done a search and it gives a 
>list of urls:
>
>episodes.php?id=4&highlight=max
>
>But how do I get it to go through all the words and highlight "max" or 
>whatever keyword it is??
>
>_
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Searching/keywords

2001-09-20 Thread olinux

you could probably use a str_replace() www.php.net
$description1 = "Episode 1 - Joey eats all of the food
in the house";

Suppose the search term is "food" - just go thru and
replace "food" with "food" or whatever tags you
want to use.

olinux

--- Matt C <[EMAIL PROTECTED]> wrote:
> I have summaries of episodes stored in a database.
> How on earth do I go 
> about highlighting keywords? I mean I have done a
> search and it gives a list 
> of urls:
> 
> episodes.php?id=4&highlight=max
> 
> But how do I get it to go through all the words and
> highlight "max" or 
> whatever keyword it is??
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Searching/keywords

2001-09-20 Thread Matt C

I have summaries of episodes stored in a database. How on earth do I go 
about highlighting keywords? I mean I have done a search and it gives a list 
of urls:

episodes.php?id=4&highlight=max

But how do I get it to go through all the words and highlight "max" or 
whatever keyword it is??

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Query Weirdness

2001-09-20 Thread Steve Cayford

When you use mysql_fetch_array you're actually retrieving an array with 
two copies of the value you're looking for. One is indexed by the column 
number and one indexed by the column name. So it looks like you're 
looping through them both and printing each out. You might want 
mysql_fetch_assoc (to use just the column name) or mysql_fetch_row (to 
use just the column number)

-Steve

On Thursday, September 20, 2001, at 05:02  PM, Chris S. wrote:

>
>
> Hello,
>
> I'm new at this php/mysql stuff, so go easy on my guys.
>
> I've got my query script up and working, but the problem is I'm getting 
> the
> same column printed twice on the html output.  Here is the output:
>
> Connected successfully
> Chris Chris
> Mark Mark
> Mike Mike
> Dee Dee
> etc...
>
> Here is my .php script:
>
>  $link = mysql_connect("localhost", "dbuser","dbpassword")
> or die ("Could not connect");
> print ("Connected successfully");
> mysql_select_db ("dapscores") or die ("Could not select database");
>
> $query   = "SELECT first_name FROM overall_results";
> $result  = mysql_query ($query) or die ("Query failed");
>
> // printing HTML result
>
> print "\n";
> while ($line = mysql_fetch_array($result)) {
> print "\t\n";
> while(list($col_name, $col_value) = each($line)) {
> print "\t\t$col_value\n";
> }
> print "\t\n";
> }
>
> print "\n";
>
>
>
> mysql_close($link);
> ?>
>
>
> Here is my database layout:
>
> mysql> describe overall_results;
> +---+-+--+-+-+---+
> | Field | Type| Null | Key | Default | Extra |
> +---+-+--+-+-+---+
> | Match_Date| date| YES  | | NULL|   |
> | Place | varchar(10) | YES  | | NULL|   |
> | Last_Name | varchar(20) | YES  | | NULL|   |
> | First_Name| varchar(20) | YES  | | NULL|   |
> | USPSA | varchar(10) | YES  | | NULL|   |
> | Class | char(3) | YES  | | NULL|   |
> | Division  | varchar(20) | YES  | | NULL|   |
> | PF| varchar(7)  | YES  | | NULL|   |
> | Lady  | char(3) | YES  | | NULL|   |
> | Mil   | varchar(4)  | YES  | | NULL|   |
> | Law   | varchar(4)  | YES  | | NULL|   |
> | F0r   | char(3) | YES  | | NULL|   |
> | Age   | varchar(20) | YES  | | NULL|   |
> | Match_Pts | float   | YES  | | NULL|   |
> | Match_percent | float   | YES  | | NULL|   |
> +---+-+--+-+-+---+
>
> If I run the query from mysql>, it works fine, just the HTML output 
> shows
> the double column thing.  Is this a database problem?  I've tried 
> different
> variations of my script and I get the same output each time.
>
> Thanks
>
> --
> Chris S.
> [EMAIL PROTECTED]
> PGP 0xDA39672B
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Query Weirdness

2001-09-20 Thread Chris S.



Hello,

I'm new at this php/mysql stuff, so go easy on my guys.

I've got my query script up and working, but the problem is I'm getting the
same column printed twice on the html output.  Here is the output:

Connected successfully
Chris Chris 
Mark Mark 
Mike Mike 
Dee Dee 
etc...

Here is my .php script:

\n";
while ($line = mysql_fetch_array($result)) {
print "\t\n";
while(list($col_name, $col_value) = each($line)) {
print "\t\t$col_value\n";
}
print "\t\n";
}

print "\n";



mysql_close($link);
?> 


Here is my database layout:

mysql> describe overall_results;
+---+-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
+---+-+--+-+-+---+
| Match_Date| date| YES  | | NULL|   |
| Place | varchar(10) | YES  | | NULL|   |
| Last_Name | varchar(20) | YES  | | NULL|   |
| First_Name| varchar(20) | YES  | | NULL|   |
| USPSA | varchar(10) | YES  | | NULL|   |
| Class | char(3) | YES  | | NULL|   |
| Division  | varchar(20) | YES  | | NULL|   |
| PF| varchar(7)  | YES  | | NULL|   |
| Lady  | char(3) | YES  | | NULL|   |
| Mil   | varchar(4)  | YES  | | NULL|   |
| Law   | varchar(4)  | YES  | | NULL|   |
| F0r   | char(3) | YES  | | NULL|   |
| Age   | varchar(20) | YES  | | NULL|   |
| Match_Pts | float   | YES  | | NULL|   |
| Match_percent | float   | YES  | | NULL|   |
+---+-+--+-+-+---+

If I run the query from mysql>, it works fine, just the HTML output shows
the double column thing.  Is this a database problem?  I've tried different
variations of my script and I get the same output each time.

Thanks

-- 
Chris S.
[EMAIL PROTECTED]
PGP 0xDA39672B


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Update Logging ???

2001-09-20 Thread Jason G.

Check out for MySQL mailing lists

http://www.mysql.com/documentation/lists.html

-JAson Garber

At 03:42 PM 9/20/2001 -0500, Christopher Raymond wrote:

>NOTES: I know this is a PHP list, but I also know that many of you are
>experienced MySQL admins. In addition, I was unable to find a MySQL
>newsgroup, so if you can help me out there, I would appreciated it and would
>most certainly post my question there.
>
>
>QUESTION: My ISP does not enable update logging with their MySQL server. Is
>it possible for them or me to turn on update logging just for MY database(s)
>???
>
>
>I appreciate any help & God Bless America,
>
>Christopher Raymond


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Update Logging ???

2001-09-20 Thread Christopher Raymond


NOTES: I know this is a PHP list, but I also know that many of you are
experienced MySQL admins. In addition, I was unable to find a MySQL
newsgroup, so if you can help me out there, I would appreciated it and would
most certainly post my question there.


QUESTION: My ISP does not enable update logging with their MySQL server. Is
it possible for them or me to turn on update logging just for MY database(s)
???


I appreciate any help & God Bless America,

Christopher Raymond 



[PHP-DB] Obj : [PHP-DB] Renaming a database name...

2001-09-20 Thread Fabien ILLIDE

Hi Arief !

Well, you should use PhpMyAdmin who can do many usefull things.
Like rename, optimize, make requests etc ...
(If you're in local. Some providers refuse this.)
 http://phpmyadmin.sourceforge.net/

Or see the ALTER TABLE function in the doc.

bye
Fabien.

Arief Fajar Nursyamsu a écrit :

> Dear All...
>
> Can I rename a database name ?
>
> Regards
>
> rief
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] about Printer()

2001-09-20 Thread Andreas D. Landmark

At 20.09.2001 03:18, cheify wrote:
>php4 suport Priner() in windows.How do I use it ?thanks very much.

http://uk.php.net/manual/en/ref.printer.php

(substitute uk for local mirror)


methinks this is in the same ballpark av php-DB, not even the same
league, it's not even the same fscking game!

-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]