Return all duplicate values in lookup (PHP, drop-down list)
Hi, I have a PHP page that I've designed as a search page. I have a number of drop-down boxes that get their dynamic values from fields in a MySQL database.
At present, if there are any entries that have duplicate values in a certain field, they are all listed, in the order of the database index. For example:
Town:
Derby
Stoke
Stafford
Stoke
Derby
Derby
Stoke
etc...
Now, what I want to do is be able to show all of the results for a given town. In the search drop-down list box, I would want each of the towns to only appear once rather than each time that it is listed; included in this, I would want the results page to then display ALL of the results that match that search criteria.
So, in the example above, "Derby" would only appear once but, when the user selected "Derby", it would return all three results in the results page.
My results page is built on a dynamic form, so I am confident that the results page would render as required. However, How do I get the drop-down list box to instruct it?
