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? Link to comment https://forums.phpfreaks.com/topic/118647-solved-sql-query-help/ 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. Link to comment https://forums.phpfreaks.com/topic/118647-solved-sql-query-help/#findComment-610819 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! Link to comment https://forums.phpfreaks.com/topic/118647-solved-sql-query-help/#findComment-610820 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 Link to comment https://forums.phpfreaks.com/topic/118647-solved-sql-query-help/#findComment-610824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.