phpretard Posted August 7, 2008 Share Posted August 7, 2008 $areaCode=$POST['areaCode']; "SELECT * FROM members WHERE PHArea='$areaCode' OR MOArea='$areaCode' OR FXArea='$areaCode' AND PaidID!=' ' " I am searching the DB for area codes but only the rows that have information in Column "PaidID" (The Paid Subscribers) The Query above does't work and I cant figure out why? Any help? Quote Link to comment Share on other sites More sharing options...
moselkady Posted August 7, 2008 Share Posted August 7, 2008 I am not sure in what order AND and OR are evaluated in MySQL but it looks like your query is behaving like this: SELECT * FROM members WHERE (PHArea='$areaCode' OR MOArea='$areaCode' OR FXArea='$areaCode') AND PaidID!=' ' Try to use parenthesis to formulate the conditions you want. Quote Link to comment Share on other sites More sharing options...
phpretard Posted August 7, 2008 Author Share Posted August 7, 2008 If there was a thank you button on the key board I would push it right..............NOW! Quote Link to comment Share on other sites More sharing options...
moselkady Posted August 7, 2008 Share Posted August 7, 2008 I just clicked on both "you welcome" and "good luck" buttons Quote Link to comment 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.