I have following MYSQL syntax but when I am running it , it gives me error to check the MYSQL manual for correct syntax.
The MYSQL query is:
SELECT `listings`.sid FROM listings
LEFT JOIN `listings_properties` `lp` ON `lp`.`object_sid` = `listings`.`sid` AND `lp`.`id` = \'ClosingDate\'
WHERE (expiration_date < NOW() OR `lp`.`value` <= NOW()) AND active = 1
No need to escape
'