MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jackson Miller Date:July 23 2003 2:56pm
Subject:Re: How do I show column names in php?
View as plain text  
Try:

$result = mysql_query("SHOW COLUMNS FROM table_name");
while ($row = mysql_fetch_array($result)) {
    foreach ($row as $key=>value) {
        echo "$key = $value";
    }
}

-Jackson

On Wednesday 23 July 2003 9:32, Jake Johnson wrote:
> I am using php and mysql and I want to show the column names.  How do I go
> about doing this without hardcoding the headers in my php?
>
> Regards,
> Jake Johnson
> jake@stripped
>
> ______________________________________________________________________
> Plutoid - http://www.plutoid.com - Shop Plutoid for the best prices on
> Rims, Car Audio, and Performance Parts.

Thread
How do I show column names in php?Jake Johnson23 Jul
  • Re: How do I show column names in php?Yves Goergen23 Jul
  • Re: How do I show column names in php?Jackson Miller23 Jul
RE: How do I show column names in php?Ow Mun Heng24 Jul