0

I currently use the following FQL to search users with name containing "Peter":

SELECT uid, name FROM user WHERE uid IN (SELECT id FROM profile WHERE CONTAINS('Peter'))

How can I know which user is my friend (<-- sounds silly)?

As far as I know, the following FQL can check whether the search result user is friend of me, or not:

SELECT uid2 FROM friend WHERE uid1 = me()

Apart from executing the 2nd query for each of the search result, is there a way to combine both query?


Update: Since FQL is going to be deprecated, Graph API solution is also welcomed.

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • You might want to give up on FQL right now as it will [no longer be supported in the next version](https://developers.facebook.com/docs/reference/fql/). – Ingo Bürk Jun 09 '14 at 09:43
  • Thanks for the information, but how to convert the above to Graph API? – Raptor Jun 09 '14 at 09:46
  • You should look at [this related question](http://stackoverflow.com/questions/23400204/get-facebook-friends-with-graph-api-v-2-0) as there have been changes with v2.0 of the Graph API. – Ingo Bürk Jun 09 '14 at 09:50

0 Answers0