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

Group Member Table

Problem

What’s the schema for the group_member table?

Solution

The group_member table records the relationships between groups and users. Its fields are listed in Table 8-12. Queries to this table will only return data the current user is allowed to see (i.e., you can’t request groups 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/Group_member_(FQL).

Table 8-12. group_member table fields

Name

Type

Index

Description

uid

int

User ID of this user.

gid

int

Group ID that this user belongs to.

positions

array

 

Any positions in the group that this user may occupy. If the user has no position in this group, positions will be null; otherwise, it will be an array listing each of her positions. Looks like the possible positions are ADMIN and OFFICER, but that’s not documented anywhere.

Note that only the fields 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

If you’d rather use the API to access groups, try the Groups.get() and Groups.getMembers() methods.

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