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 'GROUP BY r.id ORDER BY r.name' at line 5
SELECT r.* FROM site_regions r WHERE r.status = 1 AND r.state_id = GROUP BY r.id ORDER BY r.name