Thanks for the response! This helps out a lot, but I still have a question:
As far as I can read into the logic of your code, the results of the search would be imploded into a string, right? So, after the variables are replaced with results, it would read something like:
WHERE 'NY' IN 'AR, NY, TX'
if Arkansas, New York and Texas were selected in the search. This makes sense, and I'm sure works for the single-entry fields like 'State'. On the other hand, there are fields like the aforementioned 'Format', which contain imploded strings of their own. For example, if a store carries CDs, LPs and Tapes, then the store's 'formats carried' field would have an imploded string that would read 'CDs, LPs, Tapes'.
The problem I see coming up with the application of the 'IN' syntax for this query is as follows (in same post-variable format as previously):
WHERE 'CDs, LPs, Tapes' IN 'CDs, Tapes'
In this case, a hypothetical user searched for all stores that carried both CDs and Tapes, but the hypothetical store that carried both of those, plus LPs, wouldn't come up because the string didn't read exactly as the store's 'formats' field.
It seems like it would produce the store in the search result if the user searched for stores that carry CDs and LPs, though, because they would read the same way the data was stored in MySQL. Is storing a store's 'formats carried' info as an imploded string not the way to go, or perhaps there's a workaround?
Also, your code has the:
if (isset($_POST['state']))
line in it. I understand why it's in there, but there are about six fields that would also necessitate an 'IN' query (i.e. the 'formats' field, a 'genres' field, 'store features', etc.), and it doesn't seem like it would make sense to run six different queries. Is there a way of going about validating the POST info while still being able to do just one consolidated query?
I realize I'm asking a lot, but I'm about two months into learning PHP and MySQL and this is the first real problem I've run into that seems to have no documentation whatsoever available. Thanks again for the information you've already posted, it's been very helpful.
--Samuel