Hi, I am having a bit of trouble. I have a query that returns state codes from my database in a list dropdown.
<td><select name="state" id="state">
<?php
print "<option selected>All</option>";
for ($y = 0; $y < count($state); $y++)
{
print "<option>" . $state[$y] . "</option>";
}
?>
</select></td>
The problem I am having is that I have multiple records in the database that are the same so the drop down lists something like CA, UT, UT, CO, HI, CO, ID etc.
How do I filter the array so that only one record is displayed for those that have duplicates? I want to only list one state on those that have multiple entries in the database. So I get something like CA,UT,CO,HI, ID (based on example above)
Thanks
Brett