I am developing a website that acts as a portal of digital cameras.
As the pinicle of my site I am going to design a search area.
This seach is going to offer the user 7 select lists where they will be able to select their specific camera characteristics.
e.g.
Select Required Megapixels:
Select required Resolution:
Select required Lens:
Select required Memory Type:
etc...........
In each select list there will also be an option that allows the user to not specify. e.g. Select megapixels: Not specified (select all cameras irrespective of its megapixels)
I have done searches before where I simply add a value into a query. The problem is that there are many different values going into this one query, how do I organise the comma's and stop the not specified going into the query??
I get stuck here because:
- The query requires coma's to sepeate each search used, if a user does not use one of the select lists it should not be added to the query, I dont know how to organise this to structure the query properly.
- I dont want lots and lots of "if" statements
What are the best ways to overcome these problems? a class? a function?
Thanks for you help!
😃