RE: [PHP-DB] SHOW COLUMNS
| From: | Robert V. Zwink | Date: | Wed, 14 Mar 2001 21:01:44 +0000 |
| Subject: | RE: [PHP-DB] SHOW COLUMNS | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7490@lists.php.net to get a copy of this message | ||
Use: echo mysql_field_name($result, $i);
Like this:
<?php
require("Connection.php");
$query="Show Columns from Inventory";
$result= mysql_query($query);
while ($row = mysql_fetch_row($result));
{
for ($i =1;$i<mysql_num_fields($result);$i++)
//{echo $row[$i]; <-- This won't work
{echo mysql_field_name($result, $i);
}}
?>
Robert Zwink
DISCLAIMER This is not my syntax, it is taken from the original poster's
message.
-----Original Message-----
From: Mike [mailto:ampeloso@att.net]
Sent: Tuesday, March 13, 2001 7:31 PM
To: php-db@lists.php.net
Subject: [PHP-DB] SHOW COLUMNS
Im trying to use the SHOW COLUMNS Syntax from mysql in the folowing code.
It is returning nothing.The Table name is correct and there are records in
the table (not that that should matter).I dont get an error.I posted to
php.general and got no response.
<?php
require("Connection.php");
$query="Show Columns from Inventory";
$result= mysql_query($query);
while ($row = mysql_fetch_row($result));
{
for ($i =1;$i<mysql_num_fields($result);$i++)
{echo $row[$i];
}}
?>
THANKS
Mike P
mpeloso@princeton.edu
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net