SELECT a.*,b.* FROM fx_video_categories as a,fx_videos as b WHERE b.videoID=a.videoID AND a.categoryID IN () GROUP BY b.videoID LIMIT 0,5 SELECT a.*,b.* FROM fx_video_categories as a,fx_videos as b WHERE b.videoID=a.videoID AND a.categoryID IN () GROUP BY b.videoID LIMIT 0,5 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 ') GROUP BY b.videoID LIMIT 0,5' at line 1