MySql Friend of my friends and Friend of my of my Friends of my Friends

Posted by user1907522 on Stack Overflow See other posts from Stack Overflow or by user1907522
Published on 2012-12-16T08:14:48Z Indexed on 2012/12/16 11:05 UTC
Read the original article Hit count: 300

Filed under:

i have a problem with mysql query, and can't get it done in any way. I already checked the other topics, but can't get any of the solutions to work in my case. I have 2 tables, one is users id, name, email.... and second for friends is named friends :) user1_id, user2_id

now i need to get from the database all of the user info for friends of my friends, and next level friends, the Friend of my of my Friends of my Friends, those should be 2 separate queries. Of course the search should exclude me, and be distinct.

Please help.

© Stack Overflow or respective owner

Related posts about mysql