I am currently trying to get my mind around making a search form which offers users the most flexibility. I will have at least 30 to 35 text and boolean type fields.
The problem I have is dealing with multiple AND / OR operators on the form AND then how I build the WHERE part of the query.
Ultimately I would like to give users the ability to use AND and OR for each field but I am not sure that is possible. Do you have any suggestions here?
When building the query should I be kind of grouping the ANDs together and the ORs.
eg
Thank you in advance.
The problem I have is dealing with multiple AND / OR operators on the form AND then how I build the WHERE part of the query.
Ultimately I would like to give users the ability to use AND and OR for each field but I am not sure that is possible. Do you have any suggestions here?
When building the query should I be kind of grouping the ANDs together and the ORs.
eg
Code:
SELECT *
FROM myTable
WHERE (all ANDs in here) AND (all ORs in here);
Thank you in advance.