Adjusting sql statement in a function based upon input
- by Stefan
Hey there,
This is a bit urgent!
I'm trying to make a simple filter search where-by you can choose from a series of 3 drop downs and then based upon this the results are then displayed, How would I go about adjusting the sql query for each and if you were to only choose to search from aone of the 3 rather than all 3 etc...
example there could be the url with input such as: url.com?location=gb&color=3&hair=4 and still form the correct sql query for something like this: url.com?location=gb&hair=1 and not encounter problems with WHERE and AND etc etc and empty variables in the statement
Would this not need to be a massive function to check using if to see how the data is set for all possibilities?
Thanks,
Stefan