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 id!=730 ORDER BY RAND() LIMIT 1' at line 1
SELECT id FROM videos WHERE category_id=8 AND id NOT IN (730, 196, 701, 419, 417, 418, 416, ) AND id!=730 ORDER BY RAND() LIMIT 1