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