Database query failed: 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 'and g.type!='SUBMATCH' and p.type='GROUP' ORDER BY (g.phaze_id' at line 3

Last SQL query: SELECT DISTINCT `group`, phaze_id FROM games as g inner join phazes as p on p.id=g.phaze_id WHERE g.comp_id = and g.type!='SUBMATCH' and p.type='GROUP' ORDER BY (g.phaze_id=) DESC, `group`