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:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 7:31 PM
To: [EMAIL PROTECTED]
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
[EMAIL PROTECTED]

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to