Error! Could not run query:
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 'unit.detailpageurl ''
AND A.`location` != '' unit.detailpageurl ...' at line 8
Query:
SELECT IF(LENGTH(A.`location`)>=30, CONCAT(SUBSTR(A.`location`, 1, 30), '...'), A.`location`) AS label,
A.`url`, A.`total`
FROM listings_stats A, locations B, locations C
WHERE A.`location` = B.`location`
AND B.`parent_location_id` = C.`location_id`
AND A.`listing_type_id` = 2
AND A.`category_id` = 1
AND C.`location` = '' unit.detailpageurl ''
AND A.`location` != '' unit.detailpageurl '' AND A.`bedrooms` = 0 ORDER BY A.`total` DESC, label ASC