Jump to content

WHERE if


ricmetal

Recommended Posts

i have a few html select elements. they all have items like cat, dog, bear (categorized by type: animals, car brands, etc) and one item 'all'. when the user selects a specific item from a select, like dog, i need to retrieve the dogs, but if the user selects the all item (to include dogs, cats, bears), i need to retrieve all animals.

Link to comment
https://forums.phpfreaks.com/topic/256855-where-if/#findComment-1317288
Share on other sites

yeah, i had to do something like that, because depending on the amount of where clauses i needed to set the same amount of variables for the fetched information to be stored in.

im using MySQLi. i don't remember how MySQL worked in order to fetch the data from the query into the variables, but..anyway,

unless there's some other way to get the data fetched into the variables (in MySQLi) using a dynamic WHERE if query then i guess manually is the way to go.

regards

Link to comment
https://forums.phpfreaks.com/topic/256855-where-if/#findComment-1317460
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.