select count(VID) as total from video,favorites where video.VID = favorites.posting_id and type= 'video' and favorites.mid ='5' AND status=1