$sid, ':followerid'=>Auth::userid()))) { DB::query('INSERT INTO followers VALUES (\'0\', :userid, :followerid)', array(':userid'=>$sid, ':followerid'=>Auth::userid())); $countusers = DB::query('SELECT COUNT(1) FROM followers WHERE `user_id`=:id', array(':id'=>$sid))[0]['COUNT(1)']; echo 1; } else { DB::query('DELETE FROM followers WHERE user_id=:userid AND follower_id=:followerid', array(':userid'=>$sid, ':followerid'=>Auth::userid())); echo 0; } } } }