codemaster Junior Member
|
posted March 07, 2000 05:57 PM
Here is how I did it: <SELECT NAME="category"> <? mysql_pconnect("localhost","user","pass") or die ("unable to connect"); mysql_select_db("yourdb") or die ("cannot select db"); $opt_sql = "SELECT whatever FROM yourtable"; $opt_1 = mysql_query($opt_sql); while($opt_2 = mysql_fetch_row($opt_1)) { echo "<OPTION VALUE=\"" . $opt_2[0] . "\">" . $opt_2[0] . "</OPTION>\n"; } mysql_free_result($opt_1);?> </SELECT> Hope this helps.
quote: Originally posted by bbrown: Id like to load a drop down list from a mysql database using php3 and create a link to that record. Does anyone have any ideas?
|