You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 0, 18' at line 10(No Description) sql: SELECT * FROM products p WHERE enabled = 1 AND parent_id = 0 AND hidden = 0 AND offers > 0 AND salesrank <> 0 AND 1 = 1 ORDER BY LIMIT 0, 18