What would be the best way to create a filter feature in PHP so the user can select which records they want displayed in a table.
For example, a database of addresses. I want to add a feature so the user can select which county they want displayed in a table (A filter feature).
I plan to just run a for each to loop through each of the rows and add the county to a checkbox group so then the user can check which of the counties they want to be displayed then I can base my MySQL query on that but I figures it would take time especially since I'd be having 5000 or more records.
What would be the most convenient way to achieve this and is there a command or a feature in PHP to get all the unique values in a column so I can list them in the filter box?