wimvdb opened this issue on Jun 22, 2016 · 54 posts
duanemoody posted Sat, 25 June 2016 at 7:03 PM
duanemoody posted at 4:31PM Sat, 25 June 2016 - #4273627
KristiS posted at 3:23PM Fri, 24 June 2016 - #4273583
I just know there is an easier way to tell if it is a Daz, Poser, or Daz and Poser product and it will be implemented in the near future as they are working on it.
Help me figure out what I'm missing here:
Doesn't this already work?
Well, it would work if the SQL query didn't concatenate all checkmark categories as ANDs, Duane. But because it does, it only matches products where the developer checked all the same software titles the user's query did… which won't be possible with older products where newer backwards compatible versions didn't exist yet.
Whoops.
Let's assume Rendo's database is storing a product's compatible software titles in a single column (e.g. comma delimited), because that's less hairy to maintain than continually adding new columns for new products that only contain a boolean value. Where what we as users want gets more complicated is because the SQL query sent to the backend now not only has to split off all software-related checkbox values from the main query statement and make it its own WHERE clause, but you're now having to match a set of values against a column containing a set of values where at least one of the query's set has to be in the column's set. And SQL wasn't designed to match sets.
Fortunately someone else has already had to deal with this problem and solved it, rather elegantly:
http://stackoverflow.com/a/26195280/1574945
Granted, the software title values replacing val1, val2… should be character-escaped to not foul up the regex, but there's already a function for that in PHP.
Again, I'm assuming the database doesn't have ten separate columns corresponding to each checkmark. If it actually does have individual columns for each product, then just write a WHERE clause chaining ten separate productname-to-column matches using OR.
Apologies for meddling.