Error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GROUP BY fixtures.id ORDER BY round' at line 7(Query=SELECT fixtures.id AS id, fixtures.season AS season, fixtures.round AS round, fixtures.match_finished AS match_finished, fixtures.home_score AS home_score, fixtures.guest_score AS guest_score, hometeam.name AS hometeam, hometeam.national_rank AS homerank, hometeam.bot AS hometeambot, guestteam.name AS guestteam, guestteam.national_rank AS guestrank, guestteam.bot AS guestteambot FROM nz_cup_fixtures AS fixtures INNER JOIN nz_cup_teams AS hometeam ON hometeam.id = fixtures.hometeamid INNER JOIN nz_cup_teams AS guestteam ON guestteam.id = fixtures.guestteamid WHERE season=54 AND round=all GROUP BY fixtures.id ORDER BY round)