DB::query('DELETE FROM photos_comments_rates WHERE user_id=:id AND comment_id=:wid AND type=:type',array(':id'=>Auth::userid(),':wid'=>$_GET['wid'],':type'=>Vote::comment(Auth::userid(),$_GET['wid'])));
DB::query('DELETE FROM photos_comments_rates WHERE user_id=:id AND comment_id=:wid',array(':id'=>Auth::userid(),':wid'=>$_GET['wid']));
}else{
DB::query('UPDATE photos_comments_rates SET type=:type WHERE user_id=:id AND comment_id=:wid',array(':id'=>Auth::userid(),':wid'=>$_GET['wid'],':type'=>$_GET['vote']));