Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

RE: [PHP] How to obtain all the fields' names of a MySQL table? From: Adam Plocher (aplocher <email protected>)
Date: 09/25/01

How about this...

$db = "name_of_database";
$query = "DESCRIBE table_name";
$query = mysql_db_query($db,$query);
while ($row = mysql_fetch_row($query))
{
        echo "$row[0]<br>\n";
}

-----Original Message-----
From: Alex Shi [mailto:chpshi <email protected>]
Sent: Tuesday, September 25, 2001 12:03 PM
To: php-general <email protected>
Subject: [PHP] How to obtain all the fields' names of a MySQL table?

Hi,

I wanto know how can obtain all of the fields' names of a
MySQL table in a php script. Anyone have an idea about
this please help. Thanks!

Alex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected> To contact
the list administrators, e-mail: php-list-admin <email protected>