Evening all,
I've got an issue with a search string that's bugging me a bit!
The search form has 5 fields, I want users to be able to search on any combination of these, but for the search string to ignore any fields that are left blank.
At the moment, I think that the search string is searching for all 5 fields, and if any are left blank, it's searching for a blank field in the database, so no results are returned as it can't match all 5 fields.
The query i'm using at the moment is:
"SELECT * from artist WHERE userid = '$userid' AND location = '$location' AND style = '$style' AND wherework = '$studio' AND $q"
Does this make sense?