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, as id, as tid FROM category, tags, video,video_snapshot WHERE = video.category AND = tags.video_id AND category = AND tags.group_id =0 AND tags.playlist_id =0 and =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_snapshot.video_' at line 6