I have the following code:
<li>
<label>Manufacturer</label>
<select name="brand">
<?php
$sql = mysql_query("SELECT CarMake FROM cars");
while ($row = mysql_fetch_array($sql)){
echo "<option value=\"owner1\">" . $row['CarMake'] . "</option>";
}
?>
</select>
My only issue is the CarMake field has manufacturers listed more than once i.e. BMW is listed more than once so what is happening is obviously BMW is displayed more than once in the dropdown. Is there any way to get the manufacturers to display in alphabetical order and only once each?
Is there a way to add in an Any option to the dropdown so that the user can choose to search by any make rather than a specific one or can this not be done?
DISTINCTlikeSELECT DISTINCT CarMake FROM carsorder byclause as well.Anyoption to the dropdown so that the user can choose to search by any make rather than a specific one? Also the issue I'm having is that when selecting options from the dropdown box and clickingSearch, it's POSTingowner1as the value rather than the actual manufacturer name chosen from the dropdown. How do I resolve this?