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 'LIMIT 0, 12' at line 1(No Description) sql: SELECT * FROM tags t WHERE t.hidden = 0 AND t.display_alltags = 1 ORDER BY LIMIT 0, 12