jandrews3 Posted September 7, 2009 Share Posted September 7, 2009 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"; Quote Link to comment https://forums.phpfreaks.com/topic/173424-solved-query-getting-info-it-shouldnt/ Share on other sites More sharing options...
Mark Baker Posted September 7, 2009 Share Posted September 7, 2009 Is the active column nullable? Quote Link to comment https://forums.phpfreaks.com/topic/173424-solved-query-getting-info-it-shouldnt/#findComment-914204 Share on other sites More sharing options...
jandrews3 Posted September 7, 2009 Author Share Posted September 7, 2009 I use it to identify the active status of members. Persons with an ACTIVE of zero are no longer active and therefore should not show up in any queries. Quote Link to comment https://forums.phpfreaks.com/topic/173424-solved-query-getting-info-it-shouldnt/#findComment-914207 Share on other sites More sharing options...
PFMaBiSmAd Posted September 7, 2009 Share Posted September 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/173424-solved-query-getting-info-it-shouldnt/#findComment-914243 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.