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 ') GROUP BY `p`.`id` ORDER BY `p`.`ordering` ASC,`p`.`id` DESC' at line 1 SQL: SELECT `am`.`id` as manufacturer_id,`am`.`name` as manufacturer_name,`p`.`id` ,`p`.`name` ,`p`.`description` ,`p`.`image` ,`p`.`category_id` ,`p`.`sku` ,`p`.`price` ,`p`.`show_price_desc` ,`p`.`new` FROM kemi_assortment_product as p LEFT JOIN kemi_assortment_manufacturer as am ON am.id = p.manufacturer_id WHERE `status` ="1" AND `p`.`category_id` IN () GROUP BY `p`.`id` ORDER BY `p`.`ordering` ASC,`p`.`id` DESC