I am using the given code below to populate some values from a column of a table. It’s just getting filled blank..
Can you please find the problem with it ?
<select name="category">
<option value="" selected>Select a category</option>
<?php
mysql_connect("localhost","root","");
mysql_select_db("muskilaasaan");
$category = "SELECT cat FROM category";
$query_result = mysql_query($category);
while($result = mysql_fetch_array($query_result))
{
?>
<option value = "<?php echo $result['cat']?>"/>
<?php
}
?>
</select>
Changed to mysql_fetch_assoc and also you didn’t put anything in the option tags, that would cause it to appear blank.