----- Original Message ----- From: George Lioumis To: B.J.Rumsey Sent: Wednesday, January 30, 2002 11:47 AM Subject: Re: [PHP-DB] Drop down list
Try the following: <?php $option_block = ""; $get_list = "select * from <table_name>"; $res = mysql_query($get_list) or die (mysql_error()); while ($row = mysql_fetch_array($res)) { $artid= $row["artist_id"]; $art = $row["artist"]; $option_block .= "<OPTION value=\"$art_id\">$art</OPTION>"; } ?> <SELECT name="artist"> <?php echo "$option_block"; ?> </SELECT> ----- Original Message ----- From: B.J.Rumsey To: php-db Sent: Wednesday, January 30, 2002 10:17 AM Subject: [PHP-DB] Drop down list I have two fields artist_id, artist. How do I put the contents of "artist" into a dropdown list. ____________________________________________________ IncrediMail - Email has finally evolved - Click Here