Describing mysql table
| From: | Gerard Samuel | Date: | Tue, 18 Sep 2001 20:40:56 +0000 |
| Subject: | Describing mysql table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67742@lists.php.net to get a copy of this message | ||
Im trying to get results from a mysql command (describe tablename;)
into php. I know about the php functions, but I would like the mysql nameing instead. Im trying like so
$query = "DESCRIBE users";
$result = mysql_query($query);
$array = mysql_fetch_array($result);
foreach ($array as $data) {
echo "$data[0], $data[1], $data[2]<br>";} Im not getting the expected results like the mysql command line. What am I doing wrong... Thanks