Well, firstly, as long as you filter users by uidand select uidafter that - an external query looks redundant. Thus, the final request can be reduced to
SELECT uid2 FROM friend WHERE uid1=me()
Second: it is slightly better to use fb php sdk to execute FQL queries, rather than file_get_contents, for example:
$facebook->api("/fql?q={$fql}");
( fooobar.com/questions/1120244/...)