Is it possible to query a mysql database and create an array consisting of the field names for a particular table? I am trying to build a dynamic dropdown menu with the field names for a sorting a table.
thanks.
SHOW TABLE STATUS
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10249438
Theres an exmaple there.... using mysql_list_tables() and mysql_list_fields() 😉
$query="whatever"; $result=mysql_query($query); $myarray=mysql_fetch_assoc($result); $fieldnames=array_keys($myarray); //voila! $fieldnames is an array of field names!!
😉
u make everything sound so simple :p
yah, right ... actually, my username should be 'kludgemaster'...
Got lucky on this one ... 😉