That is the most strangely created friends list implementation that I've ever laid eyes on. But you want to do a query that looks for id1 and id2, and only selects rows where id1 or id2 equals the id you're looking for.
Then, select the id that is NOT the id of the person who's friends list is being loaded, and that's their friend.
Although, I'd think of a different way to do it, but I guess your way doesn't take up much space...