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 ')' at line 1select id as id from projecten where status = '2' and volgorde = (select min(volgorde) from projecten where volgorde > )