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 'and (sp.subscription_products_flags & 4 != 4 or sp.subscription_products_flags i' at line 1

select count(subscription_products_diamond_code) as total from subscription_products sp left join manufacturers m on m.manufacturers_id=sp.manufacturers_id left join subscription_discount sd on sd.subscription_disc_code=sp.subscription_products_disc_code where sd.subscription_discount_id=1 and sp.subscription_products_diamond_code like 'JUL09%' and sp.not_for_sale=0 and ((sp.subscription_products_title like '%%') )and sp.manufacturers_id= and (sp.subscription_products_flags & 4 != 4 or sp.subscription_products_flags is null) ORDER BY sp.subscription_products_diamond_code

[TEP STOP]