i want to programm a script where users can add their friends. if they click on another profile i want to show the conections between this profil an the user's profil. (eg. person A knows person B and person B knows person C and C knows D: if person A is on the profilsite of person D, he should see the connection persons B and C [A<>B<>C<>D] ) -> how can i do this in php & mysql i had some tries with 'Breadth-first search'-algorithms but i didn't find a working solution..