Error: SELECT *, alt_categories.ID as CategoryID FROM alt_categorygroups INNER JOIN alt_categories ON alt_categorygroups.CategoryID = alt_categories.ID WHERE CatID = GROUP BY alt_categories.CatNameTr ORDER BY alt_categories.ID

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 alt_categories.CatNameTr ORDER BY alt_categories.ID' at line 3