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 ') ORDER BY catName' at line 1 SQL:' SELECT id, catName, catDescription, ratingMin, ratingMax, ageMin, ageMax FROM ENF_tournamentCategories WHERE id IN () ORDER BY catName'