4 Select boxe's web search
Posted: Mon Nov 17, 2008 3:19 am
Hello to all,
I am developing an web application and i have some problems creating the advanced search on this aplication.
I have 4 select boxes and an submit button. All i want is to make search on database from those select boxes. So the user can select just one selct box, or he can select two, or he can select all of them i need to get those results, what ever the user select's i want thr search script to do that.
i have one solution on my mind but i dont think that's the best one.
Let say i will use if statements. For example:
if the first select box is selected query the database only with that variable, if the first and second select boxes are selected give me the query for both variables, and so one. But this way i will need to make a lot of query's because there are a lot of combination's. A least i will need to create 16 query's.
I hope someone knows what i am trying to do and will help me on this task.
regards
I am developing an web application and i have some problems creating the advanced search on this aplication.
I have 4 select boxes and an submit button. All i want is to make search on database from those select boxes. So the user can select just one selct box, or he can select two, or he can select all of them i need to get those results, what ever the user select's i want thr search script to do that.
i have one solution on my mind but i dont think that's the best one.
Let say i will use if statements. For example:
if the first select box is selected query the database only with that variable, if the first and second select boxes are selected give me the query for both variables, and so one. But this way i will need to make a lot of query's because there are a lot of combination's. A least i will need to create 16 query's.
I hope someone knows what i am trying to do and will help me on this task.
regards