I want to do a form selection pulldown menu box which sorts by multiple input variables. For example, the following is an example of the mysql datatable which holds all the data I want to put into the pulldown.
id state city company_name 0 California San Diego SD Supply 1 California San Diego SD Tech 2 California Los Angles LA Suppy 3 Texas Austin Austin Supply
An example of the selection pulldown from this data, formatted and sorted how I want is:
-California -Los Angles LA Supply -San Diego SD Supply SD Tech -Texas -Austin Austin Supply
See the states are sorted firstly, then under each state the citys are sorted and then each company name is sorted under each city. What is the block of php code to do this? I assume we first need to pull state and sort those results, then pull city and sort, and then pull company_name and sort.
Additional difficulties, I want to do error checking making sure they only select company_names and not cities or states. So selecting a state or city upon being processed would be an invalid choice.
Thanks for any help.