Very simple.
I have...
1. A table of a mysql database with 4 fields.
2. The table contains many entries, some of which are repeated.
I need...
1. 4 filters in the form of 4 drop-down lists. Drop-down list 1 populated by [unique values] of field 1, dd list 2 with field 2 etc.
2. Selected option in 1st drop-down, constrains the items in 2nd drop-down to be filtered such that field 1 = selected option 1. 3rd drop-down conditional on 2nd and 4th on 3rd. 4 consecutive filters!
This must be done with AJAX as I do not want page to refresh between each filter choice. 2nd filter must only be available if a specific value in 1st filter is NOT chosen ['The world' in ex below].
EX TABLE
1 The World N/A CAR RED
2 England BRISTOL VAN RED
3 England LONDON CAR GREEN
4 Italy MILAN BIKE BLUE
5 France PARIS BIKE GREEN
6 France CANNES CAR YELLOW
7 Spain MADRID BOAT YELLOW
values
selected: 1st dd= England, 2nd dd=London, 3rd dd=Car, 4th dd=Green
should return row 2 only.
final result =
$query="SELECT * FROM table WHERE country = '$dd1' AND city = '$dd2' AND vehicle = '$dd3' AND colour = '$dd3'
That's the idea anyway. I know scripts exist to do this with iframes, which I do not want. For someone who understands AJAX this should be pretty quick! Thanks!