Error, query failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by archived, printdate' at line 1 select count(id) as cc from maps where maps.cartographerid = order by archived, printdate