You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Bush' and postcode = 'W12, W11') OR (title = 'W12, W11' AND postcode = 'Shephe' at line 1

select * from locations where (title = 'Shepherd's Bush' and postcode = 'W12, W11') OR (title = 'W12, W11' AND postcode = 'Shepherd's Bush') LIMIT 1