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, 18' at line 11(No Description) sql: SELECT m.*, COUNT(p.id) as productcount FROM manufacturers m, products p WHERE p.manufacturer_id = m.id AND m.display_allmanufacturers = 1 AND p.enabled = 1 AND p.hidden = 0 AND p.parent_id = 0 AND p.offers > 0 GROUP BY m.id ORDER BY LIMIT 0, 18