SQL problem: SELECT * FROM (SELECT globid,ordine,title FROM globalmoneta WHERE parentid="" AND ordine<"" GROUP BY ordine DESC LIMIT 1) AS a; 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 'DESC LIMIT 1) AS a' at line 3