What’s the schema for the
page_fan table records
the relationships between
users. Its fields are listed in
Table 8-15. Queries to this table will
only return data the current user is allowed to see (i.e., you can’t
pages that the current
loggedinuser can’t see). More information
about this table, including an up-to-date listing of fields, can be
found at http://wiki.developers.facebook.com/index.php/Page_fan_(FQL).
Table 8-15. page_fan table fields
User ID of this user.
Page ID of the Page the user is a fan of.
Type of this Page.
There are a way too many different Page types to enumerate
here. You can see them on the Create a Page page (http://www.facebook.com/pages/create.php).
They’re generally stored in the database in all caps, with
underscores in place of spaces (e.g.,
Note that only the field marked as “Index” in this table can be
used in an FQL query’s
clause, but any of the fields can appear in the
There’s a really obvious index missing from this table, which
makes working with it a whole lot harder:
page_id (although the field exists, the lack
of an index on it means you can’t include it in FQL queries as part of
WHERE clause). As it currently stands, you can find the Pages a user is a fan of but not the users who are fans of a Page. It would fit better with the general FQL model to enable that index ...