Error Number: 1064

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 ') as all_pages WHERE id>0 ORDER BY created desc LIMIT 20' at line 1

Select SQL_CALC_FOUND_ROWS * from () as all_pages WHERE id>0 ORDER BY created desc LIMIT 20