Column names of certain fields
Posted: Mon Feb 27, 2006 9:39 pm
Is there an easy way to display the column name(s) from a mysql result? For example, if I have an SQL statement like and assuming that I do not know the SQL statement beforehand, is there a way to find the column name and display it?
I know will show all of the fields in a table, but I just need to display the ones used in the query.
Sorry if what I'm trying to say isn't clear, but that's the best way I can think of stating it right now.
Thanks in advance.
Code: Select all
SELECT id,name FROM `table`I know
Code: Select all
SHOW FIELDS FROMSorry if what I'm trying to say isn't clear, but that's the best way I can think of stating it right now.
Thanks in advance.