I’m stuck at a point in making mutual friends code for my website. I have read some of the posts here but it didn’t help.
here is my mysql query:
select *
from friend_list
where uid='7'
and status=1
and friend_id !='3'
union
select *
from friend_list
where uid='3'
and status=1
and friend_id !='7'
this displays all the friends of login user and the friends of the profile i visit.
output is this —-
id uid friend_id status
36 7 4 1
39 7 5 1
40 7 8 1
1 3 4 1
from this table i want the freind_id 4 only as this is mutual.
1 Answer