所以我有一个名为follow_sys
的表,其中有三列id
和follower
和following
包含关注者和跟随者的用户名,所以我想获取所有我追随者,但他们没有跟着我,我该怎么做?
我尝试了自我加入,但没有成功,我很困惑
$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>";
}