Hi, I am using MySQL and PHP to populate/make a dropdown box from a database.
Problem is that the dropdown box has the same entries twice.
Please suggest the cause of this, someone.
This is my code:
<?php
$dealer_list = $connector->query("SELECT DISTINCT shop_region FROM dealers ORDER BY shop_region");
echo "<form name='dropdown_region' method='POST'>";
echo "<select name='county' value=''>";
echo "<option value=''>Please Select</option>";
while($county = mysql_fetch_array($dealer_list))
{
$shop_region = $county['shop_region'];
echo "<option value='$shop_region'>".ucwords(strtolower($county[shop_region]))."</option>";
}
echo "</select>";
?>
Cheers