Invalid query: 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 facilities.facilityID ORDER BY facilities.name' at line 5
Whole query: SELECT facilities.* FROM beaches_facilities INNER JOIN facilities ON facilities.facilityID = beaches_facilities.facilityID AND beachID = GROUP BY facilities.facilityID ORDER BY facilities.name