RE: drop down list

From: Date: Wed, 30 Jan 2002 06:45:48 +0000
Subject: RE: drop down list
Groups: php.db 
Request: Send a blank email to php-db+get-16297@lists.php.net to get a copy of this message
BJ, A simple "while" command should do it. Try something like this: print("<select name=artist>\n"); $qry = "SELECT artist_id, artist FROM $db"; $res = mysql_query($qry) or die(mysql_error()); while($data = mysql_fetch_array($res)) { print("<option value=\"$data[0]\">$data[1]</option>\n"); } print("</option>"); That should do the trick for ya! Best, John >I have two fields artist_id, artist. How do I put the contents of "artist" into a dropdown list. __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com

« previous php.db (#16297) next »