1064 - 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 '?osCsid=a55d99aae24ec3f8d261ade931259e4b and op.products_price > 0 group by prod' at line 1
SELECT p.products_name_en as products_name, p.products_id, sum(op.products_quantity) as sold from orders o left join orders_products op using(orders_id) left join products p using(products_id) left join publishers pub using(publishers_id) left join products_inventory pi using(products_id) left join products_to_categories p2cat using(products_id) WHERE date_purchased > '2019-02-10' and orders_type != 'Wholesale' and p.products_status = 1 and pinv_quantity_avail > 0 and p2cat.categories_id = 1013?osCsid=a55d99aae24ec3f8d261ade931259e4b and op.products_price > 0 group by products_id order by sold desc, p.products_price desc