I want to populate a drop down list with values from database.
<?php
require 'conn.php';
$filter=mysql_query("select distinct fuel_type from car");
while($row = mysql_fetch_array($filter)) {
$options ="<option>" . $row['fuel_type'] . "</option>";
$menu="<form id='filter' name='filter' method='post' action=''>
<p><label>Filter</label></p>
<select name='filter' id='filter'>
" . $options . "
</select>
</form>";
echo $menu;
}
?>
The issue is that I get two lists instead of one list with the values inside. Please advise
