SELECT p.id, pt.name FROM pages p INNER JOIN pages_text pt ON p.id = pt.page_id AND pt.language_id = 1 INNER JOIN products_params_sizes ps ON p.id = ps.size_id AND ps.quantity > 0 AND ps.product_id = WHERE 1 GROUP BY p.id ORDER BY p.order_id
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 'WHERE 1 GROUP BY p.id ORDER BY p.order_id' at line 5