Get the friends of everyone in the table who is friend of mine. I find out who my friends are by looking in the friends table (if asking them to help me move house doesn't work), and I find out who their friends are by looking in the friends table.
select f1.friendid from friends f1, friends f2 where f1.id = f2.friendid and f2.id=$myid
Assuming everyone has an id in their id field, and their friends are listed in the friends table in the friendid field.