Jump to content

[SOLVED] SQL Query Help


phpretard

Recommended Posts

$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

 

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.

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.