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 enabled = 1 AND in_stock>0' at line 1
SELECT DISTINCT(pr.categoryID) FROM SC_products AS pr JOIN SC_cats_related_items AS rel ON (rel.`productID` = pr.`productID`) WHERE Owner IN () AND enabled = 1 AND in_stock>0