我该如何获取我关注的人,但他们不关注?

时间:2018-07-01 22:29:26

标签: php mysql sql-server ajax mysqli

所以我有一个名为follow_sys的表,其中有三列idfollowerfollowing包含关注者和跟随者的用户名,所以我想获取所有我追随者,但他们没有跟着我,我该怎么做?

我尝试了自我加入,但没有成功,我很困惑

    $sqlFollowing      = "SELECT * from follows_syds t1
                               join follows_syds t2 on
                               t1.follower != t2.following
                               where
                               t1.follower = ?
                               group by t1.id";
$Following         = $conn -> prepare($sqlFollowing);
$Following        -> bind_param('s',$getUser);
$Following        -> execute();
$FollowingGET      = $Following -> get_result();
$FollowingRows     = $FollowingGET -> num_rows;

while($b = $FollowingGET -> fetch_assoc()){

print_r($b);
echo "</br>";
}

0 个答案:

没有答案