Photo Tag Table

Problem

What’s the schema for the photo_tag table?

Solution

The photo_tag table contains the relationship between photos and the users who have been tagged in them. Its fields are listed in Table 8-17. Queries to this table will only return data the current user is allowed to see (i.e., you can’t request photos 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/Photo_tag_(FQL).

Table 8-17. photo_tag table fields

Name

Type

Index

Description

pid

int

Photo ID of this photo.

subject

int

User ID of the person tagged in this photo.

text

string

 

The text entered for this tag.

xcoord

float

 

The x coordinate of the center of the tag square.

ycoord

float

 

The y coordinate of the center of the tag square.

created

int

 

The date this tag was created, in epoch seconds. See Formatting Relative Time for more about epoch seconds.

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 photo_tags, try the Photos.get() and Photos.getTags() method.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.