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 '' at line 1select count(*) as count, group_concat(distinct(`city`)) as 'city', group_concat(distinct(`subarea`)) as 'subarea', group_concat(distinct(`listingtype`)) as 'listingtype', MIN(listprice_2) as 'startingfrom', max(last_mod) as 'last_mod' from boards.listings where status = 'Active' and reciprocity = 'Yes' and `table` in ('mlsr_listings') and