RE: [PHP] How to obtain all the fields' names of a MySQL table?
| From: | Adam Plocher | Date: | Tue, 25 Sep 2001 19:42:15 +0000 |
| Subject: | RE: [PHP] How to obtain all the fields' names of a MySQL table? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-68764@lists.php.net to get a copy of this message | ||
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@netvigator.ca]
Sent: Tuesday, September 25, 2001 12:03 PM
To: php-general@lists.php.net
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@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To contact
the list administrators, e-mail: php-list-admin@lists.php.net