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 'AND restaurant.restaurant_commune = communes.commune_id AND restaurant_online = ' at line 2