Your logic is not entirely clear. You must enclose the logical subordinate clauses in parentheses so that MySQL knows what you really want.
Do you want to
ad_status='1'
AND (ad_region='Location One' OR ad_region='Location Two' OR ad_region='Location Three')
AND ad_type='For Rent'
?
If you do this, you are probably better off using IN()
, for example:
SELECT * FROM ads
WHERE ad_status='1'
AND ad_region IN ('Location One', 'Location Two', 'Location Three')
AND ad_type='For Rent'
ORDER BY ad_id
DESC LIMIT 10
;
source
share