Error : (SELECT video.filename,tags.tag as tag, count( tags.tag ) AS tag_count,video.title as title,video.duration as duration,video_snapshot.img1 as img,video.id as id,tags.id as tid FROM category, tags, video,video_snapshot WHERE category.id = video.category AND video.id = tags.video_id AND category = AND tags.group_id =0 AND tags.playlist_id =0 and video.id =video_snapshot.video_id GROUP BY tags.tag ORDER BY RAND() limit 0,80) :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 tags.group_id =0 AND tags.playlist_id =0 and video.id =video_snapshot.video_' at line 6