O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Checking for a Friend Request Between Two Users

Problem

I need to check to see whether there’s a pending friend request between two specific users using FQL.

Solution

SELECT uid_to, uid_from FROM friend_request WHERE uid_from
 = $user2 AND uid_to = $user1;

Discussion

You can run this query only when user1 is the current loggedinuser.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required