Hiya
Does anyone know how I can find out of filtering a table by using more than one filter selected from drop down boxes.
e.g
Table consists of all users
SELECT FROM users
Filter selected from drop down box called Sex= Female
I want the mysql to change to:
SELECT FROM users WHERE sex = Female
Now say 2 filters are selected
Sex= Female and work=Part-time
I want the query to build to
SELECT * FROM users WHERE sex=female and work=Part-time
See I want the relevant mysql query to be built checking the filters, if none set kool just do select * from User but if all five filters are set I want to concatenate the WHERE CLAUSE and the necessary AND clauses generically.
I think it can be done using a counter to add the equivalent WHERE and AND within query ...depending on the number of filters selected.
Has anyone got a snippet of code that may help me, or point me to a tutorial
Thanx
Bobby