An Error Was Encountered

Error Number: 1064

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 photos_gallery_id ORDER BY gallery_id DESC' at line 5

SELECT * ,COUNT(photos_gallery_id) as total FROM sp_places_gallery LEFT JOIN sp_places_photos ON gallery_id = photos_gallery_id WHERE gallery_places_id = GROUP BY photos_gallery_id ORDER BY gallery_id DESC