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 ') op on p.products_id=op.products_id where op.products_id is null) pp' at line 1
select count(*) as times from (select p.* from (select * from product where red=0 and (sid='1020041419_55590A88D' or sid2='1020041419_55590A88D' or sid3='1020041419_55590A88D' or sid4='1020041419_55590A88D' or sid5='1020041419_55590A88D' or sid6='1020041419_55590A88D' or sid7='1020041419_55590A88D' or sid8='1020041419_55590A88D')) p left join (select ops.* from orders_products ops,orders o where ops.orders_id=o.orders_id and customers_id=) op on p.products_id=op.products_id where op.products_id is null) pp