Re: [PHP] Collecting info about columns in a table

2006-01-30 Thread Miles Thompson
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Collecting info about columns in a table

2006-01-29 Thread Gerry Danen
Afan, Here's some code that will show enum values: $q2 = "describe ". $tname . " ;"; $r2 = mysql_query($q2) or die(mysql_error()); while ( $a2 = mysql_fetch_array($r2) ) { $els = count($a2); echo ""; for ($i2 = 0; $i2 < $els; $i2++) { $f = $a2[$i2]

Re: [PHP] Collecting info about columns in a table

2006-01-29 Thread Gerry Danen
I think Afan means they are values in an enum field. But I may be mistaken... :) Gerry On 1/29/06, tedd <[EMAIL PROTECTED]> wrote: > >Hi to all, > >I need to collect info about columns from a selected table. > >I use this: > > > >$result = mysql_query("SELECT * FROM ". $TableName); > >$fields = m

Re: [PHP] Collecting info about columns in a table

2006-01-29 Thread tedd
Hi to all, I need to collect info about columns from a selected table. I use this: $result = mysql_query("SELECT * FROM ". $TableName); $fields = mysql_num_fields($result); for ($i=0; $i < $fields; $i++) { $type = mysql_field_type($result, $i); $name = mysql_field_name($result,

[PHP] Collecting info about columns in a table

2006-01-29 Thread Afan Pasalic
Hi to all, I need to collect info about columns from a selected table. I use this: $result = mysql_query("SELECT * FROM ". $TableName); $fields = mysql_num_fields($result); for ($i=0; $i < $fields; $i++) { $type = mysql_field_type($result, $i); $name = mysql_field_name($result,