joesaddigh Posted March 9, 2009 Share Posted March 9, 2009 I am having trouble populating a dropdown box from a query. It seems to work fine in the sense that there is the correct amount of values however you cannot see them. <?php //A dropdown box populated from the language table to display all of the languages require "connectstudent.php"; $querylang="SELECT language FROM language"; $resultlang = mysql_query($querylang); echo "<select name=category value=''></option>"; while($lang= mysql_fetch_array($resultlang)) { echo "<option value=$lang[language]</option>"; } echo "</select>";// Closing of list box ?> Thanks Link to comment https://forums.phpfreaks.com/topic/148619-populating-a-drop-down-box-with-a-query/ Share on other sites More sharing options...
kickstart Posted March 9, 2009 Share Posted March 9, 2009 Hi Try taking the </option> off the line that puts out the select. All the best Keith Link to comment https://forums.phpfreaks.com/topic/148619-populating-a-drop-down-box-with-a-query/#findComment-780450 Share on other sites More sharing options...
joesaddigh Posted March 9, 2009 Author Share Posted March 9, 2009 Thanks Keith Link to comment https://forums.phpfreaks.com/topic/148619-populating-a-drop-down-box-with-a-query/#findComment-780529 Share on other sites More sharing options...
jcombs_31 Posted March 9, 2009 Share Posted March 9, 2009 You still need </option>, but you are missing a closing brace > and aren't displaying the value inside the option tag. <option value='something> Put IT Here too </option> Link to comment https://forums.phpfreaks.com/topic/148619-populating-a-drop-down-box-with-a-query/#findComment-780542 Share on other sites More sharing options...
kickstart Posted March 9, 2009 Share Posted March 9, 2009 You still need </option>, but you are missing a closing brace > and aren't displaying the value inside the option tag. Doh, should have spotted that. However he has an extra </option> without an opening option. All the best Keith Link to comment https://forums.phpfreaks.com/topic/148619-populating-a-drop-down-box-with-a-query/#findComment-780556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.