Jump to content

Populating a drop down box with a query


joesaddigh

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.