Fill in a drop-down list with fields from the database without duplicates?

advertisements

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?


$sql = mysql_query("SELECT DISTINCT CarMake FROM cars ORDER BY CarMake ASC");