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

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.

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