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

Friend Request Table

Problem

What’s the schema for the friend_request table?

Solution

The friend_request table records the friendship requests between two users. Its fields are listed in Table 8-8. Queries to this table will only return data the current user is allowed to see (meaning you can’t request friendships for users the current loggedinuser isn’t friends with). More information about this table, including an up-to-date listing of fields, can be found at http://wiki.developers.facebook.com/index.php/Friend_request_(FQL).

Table 8-8. friend_request table fields

Name

Type

Index

Description

uid_to

int

uid (user ID) of the user this request went to. You can query only on the current loggedinuser.

uid_from

int

 

uid (user ID) of the user this request came from.

Note that only the field marked as “Index” in this table can be used in an FQL query’s WHERE clause, but any of the fields can appear in the SELECT.

Discussion

This table isn’t all that useful on its own, since it contains only two data points, but you can combine it with other tables as a subquery.

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