tet3828 Posted November 6, 2006 Share Posted November 6, 2006 Im looking to populate a drop down menu with whatever value maybe in a column of my SQL database. example:in my 'products' database itemCat (item catagory) maybe Holiday, Beauty, Cosmetic,ect. How would I make each of these values show in my dropdown box?or would it be better to use radio boxes? Link to comment https://forums.phpfreaks.com/topic/26311-populate-dropdown-with-database-values/ Share on other sites More sharing options...
Gruzin Posted November 6, 2006 Share Posted November 6, 2006 [code]<?phpphp require("config.php");$result = mysql_query("SELECT * FROM spell");?><select name="wordlist"> <option value="1" selected>Select Word</option><?php while($row = mysql_fetch_array($result)){ echo "<option value=\"$row['words']\">$row['words']</option>\n"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/26311-populate-dropdown-with-database-values/#findComment-120290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.