A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Halloran Hill' AND l.postcode = '5158' AND l.status = '1' GROUP BY l.id ORD...' at line 1

SELECT l.*,COALESCE(lm.featured_image,-1) AS featured_image FROM tbl_locations AS l LEFT JOIN tbl_location_media AS lm ON lm.location_id = l.id WHERE l.suburb = 'O'Halloran Hill' AND l.postcode = '5158' AND l.status = '1' GROUP BY l.id ORDER by CASE WHEN FIND_IN_SET('2023', l.confirmed_years) > 0 AND ( SELECT COUNT(*) FROM tbl_location_media WHERE tbl_location_media.location_id = l.id and tbl_location_media.status = 1 ) > 0 THEN 1 WHEN FIND_IN_SET('2023', l.confirmed_years) > 0 THEN 2 ELSE 3 END, CASE WHEN FIND_IN_SET('5', l.grading) > 0 THEN l.grading END DESC

Filename: controllers/Index.php

Line Number: 1403