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 ') ORDER BY `viewed_times_fixed` DESC LIMIT 30' at line 1
SQL query:
SELECT COUNT(DISTINCT p.productID) FROM ss_products p where (enabled=1 OR promotion=1) AND productID IN () ORDER BY `viewed_times_fixed` DESC LIMIT 30