RE: [PHP-GENERAL] Finding column names..
| From: | Jason Stechschulte | Date: | Fri, 23 Jun 2000 14:52:54 +0000 |
| Subject: | RE: [PHP-GENERAL] Finding column names.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2802@lists.php.net to get a copy of this message | ||
This should do it. Haven't tested it though.
$sql = "select * from table_name";
$result = msyql=query($sql, $link); // where link is the result of the
connect.
$fields = mysql_num_fields($result);
echo(mysql_field_name($result, ($fields - 1)));
-----Original Message-----
From: Chad Day [mailto:cday@beachassociates.com]
Sent: Friday, June 23, 2000 10:46 AM
To: 'php-general@lists.php.net'
Subject: [PHP-GENERAL] Finding column names..
How can I find the column name of the last column in a table?
I've been fooling around with mysql_list_fields and stuff, but am not sure
how to get the value of the last column. Can anyone help?
Thanks,
Chad Day
Beach Associates
When I speak german... I think german in my head... but like...Do skript
kiddies see a w40l3 8uncha 1's and 0's and 3's and 4's and 7's in their
h34d'5 w43n t43y R +a1k1n6 ? -- SirStanley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net