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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.