My MySQL tables structure is like this.
USER
uid
FRIENDS
fuid,fuid2,fapproved
For each friend relationship I insert 2 records in FRIENDS. If user 1 is friend of user 2 then the next rows are inserted into FRIENDS
1,2,1
2,1,1
1,3,1
3,1,1
2,3,1
3,2,1
User id 3 is friend of user id 1 and user id 2
How to get user id 3 in one sql query?
Given two users @friend1 and @friend2 find all the users who are mutual friends of them: