PDA

View Full Version : Echo Database Field Names


macleodjb
05-03-2007, 05:33 PM
Is there a way you can echo the field name that you have retrieved from your database query.

For instance, lets say i have a table that has "ItemNumber", "PartNumber", "Description".

I want to create a label using the same name as what's in the table. Can this be done?

Brandoe85
05-03-2007, 05:40 PM
Check out SHOW COLUMNS:
http://dev.mysql.com/doc/refman/5.0/en/show-columns.html

Good luck.

/edit
Actually, not what you needed...might be helpful to someone though, nonetheless :)

Fumigator
05-03-2007, 05:49 PM
If you use PHP you can use mysql_field_name() (http://us2.php.net/manual/en/function.mysql-field-name.php).

Daemonspyre
05-11-2007, 02:49 PM
If you use ASP, you can use fld.name