[B]SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE 'pattern'][/B]
It will return a record set, one row for each field in the table, with name, field type, Null-Yes/No, Key type, default value and additional attributes.
@scottyrobauthorFeb 09.2007 — #Way, i never knew about the show function... Been making a few little scripts for my site now! Thanks very much for that.. In one of my scripts im trying to echo all of the tables in my DB into a drop down menu... "SHOW tables"
Id normally do this my something like echo $row['rowname']; but i cant do that here...
Since you don't know the column name - there's only one - you use [B]mysql_fetch_array()[/B] as usual, but instead of [B]echo $row['colname'][/B], use [B]echo $row[0][/B].