PHP 4.0 Bug #5409: Mysql: Return Array of Fields
| From: | nathan at cjhunter dot com | Date: | Thu, 06 Jul 2000 15:49:30 +0000 |
| Subject: | PHP 4.0 Bug #5409: Mysql: Return Array of Fields | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23604@lists.php.net to get a copy of this message | ||
From: nathan@cjhunter.com
Operating system: Linux 2.0.14
PHP version: 4.0.0
PHP Bug Type: Feature/Change Request
Bug description: Mysql: Return Array of Fields
I would like to see a mysql function that returns the field names of a query as an array of names.
If this is good I elect mysql_fetch_fields() as the function name (with the added 's' on
the end).
ex
$result = mysql_query("select * from table");
$fields = mysql_fetch_fields($result);
echo implode(",\n", $fields);
/* This would print out all the field names like so
field1,
field2,
field3,
This is just a conceptual example as I see better uses for this function
*/