Jump to content

Recommended Posts

The following query is getting data for rows with an ACTIVE value of zero. I don't understand. Something must be wrong with my logic, but I don't know what?

 

   $queryc = "SELECT * FROM ithf_members WHERE active > 11 AND con_order > 10 AND (".$srch." LIKE '%$this%' OR s_".$srch." LIKE '%$this%' OR t_".$srch." LIKE '%$this%') ORDER BY con_order, country, lname, fname";

 

In the particular instance where it is being used, $srch = "state", so the query would read:

   $queryc = "SELECT * FROM ithf_members WHERE active > 11 AND con_order > 10 AND (state LIKE '%$this%' OR s_state LIKE '%$this%' OR t_state LIKE '%$this%') ORDER BY con_order, country, lname, fname";

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/173424-solved-query-getting-info-it-shouldnt/
Share on other sites

Either your active column is not an INT type, or the value in it is not actually less than or equal to 11, or that is not the actual query that is being executed (typo's happen in variable names in code...)

 

You need to provide supporting evidence about what your column definition is, what data is in the row(s) that are being matched that you think should not be, and what is your actual code that is executing that query and outputting the results that lead you to believe it is returning rows it should not.

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.