Re: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread John W. Holmes
Dillon, John wrote: ..but even if I can get the names and number of fields during 'run-time', how do I make the following statement applicable to a variable number of fields: while(list($a,$b...)= mysql_fetch_array($result)) or is there another way to extract which would work? $num_fields = mysql_

RE: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
ion.mysql-num-fields.php -Original Message----- From: Dillon, John [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 17:05 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Extracting result - unknown number of fields ..but even if I can get the names and number of fields during 

Re: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread John W. Holmes
Dillon, John wrote: OK, please ignore, I believe I've found the answer in the manual notes: $query="your SQL"; $result=mysql_query($query) or die("Query ($query) sucks!"); $fields=mysql_num_fields($result); echo "\n"; for ($i=0; $i < mysql_num_fields($result); $i++) //Table Header Calculate the v

RE: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 16:29 To: Dillon, John; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Extracting result - unknown number of fields From: "Dillon, John" <[EMAIL PROTECTED]> > While doing a cross tabulation, I've got

Re: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread CPT John W. Holmes
From: "Dillon, John" <[EMAIL PROTECTED]> > While doing a cross tabulation, I've got a query which gives me a variable > number of fields: Maybe mysql_num_fields() and mysql_field_name() will be of use, here? Check the manual.. ---John Holmes... -- PHP Database Mailing List (http://www.php.net