how can i fetch the people i follow but they don't follow back?
how can i fetch the people i follow but they don't follow back?
so i have a table called follow_sys
with three columns id
and follower
and following
containing the usernames of followers and followed ,so i want to fetch all of the followers i follow but they don't follow me back, how can i do that ?
follow_sys
id
follower
following
i tried a self join but it didn't work, i'm confused
$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>";
}
follow_sys
follow_syds
id
containing the usernames instead of ids
follow_syds
i insert username wish is unique per every user into that table when a user follow someon, the follow and follower are varchar column– AY- CLOWN
Jul 1 at 22:43
follow_syds
oh yes the id is a primary key actually
– AY- CLOWN
Jul 1 at 22:57
What do you mean by it didn't work? Did you get the wrong result, or an error, or ??
– DancingFool
Jul 2 at 0:38
non matter what i do it gets all the follower i only want the people i follow but they don't follow me back
– AY- CLOWN
Jul 2 at 1:42
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Is the table called
follow_sys
now orfollow_syds
? You are grouping byid
even though you statecontaining the usernames instead of ids
How is that possible?– Xatenev
Jul 1 at 22:41