MySQL Error Occured
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 (Q11!='0' AND Q11 NOT LIKE '-%' OR Q12!='0' AND Q12 NOT LIKE '-%' OR Q13!='0' at line 1

QUERY = SELECT DISTINCT cat_name, count(cat_name) as total_cat, CubeCart_category.cat_id FROM CubeCart_category INNER JOIN CubeCart_inventory ON CubeCart_inventory.cat_id = CubeCart_category.cat_id INNER JOIN CubeCart_inventory_sizes ON CubeCart_inventory_sizes.productId = CubeCart_inventory.productId WHERE disable = 0 AND CubeCart_inventory.brand_id = AND (Q11!='0' AND Q11 NOT LIKE '-%' OR Q12!='0' AND Q12 NOT LIKE '-%' OR Q13!='0' AND Q13 NOT LIKE '-%' OR Q14!='0' AND Q14 NOT LIKE '-%' OR Q15!='0' AND Q15 NOT LIKE '-%' OR Q16!='0' AND Q16 NOT LIKE '-%' OR Q17!='0' AND Q17 NOT LIKE '-%' OR Q18!='0' AND Q18 NOT LIKE '-%' OR Q19!='0' AND Q19 NOT LIKE '-%' OR Q20!='0' AND Q20 NOT LIKE '-%' OR Q21!='0' AND Q21 NOT LIKE '-%' OR Q22!='0' AND Q22 NOT LIKE '-%' OR Q23!='0' AND Q23 NOT LIKE '-%') GROUP BY cat_name