Jump to content

[SOLVED] Query getting info it shouldn't


jandrews3

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.

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.