Michael Waterfall
Michael Waterfall

Reputation: 20569

Getting list of my friends that are tagged in a photo

Users, events and groups can all be tagged in a photo. In the available fields from photo_tag, you can't distinguish what subject id is a user, event or group. I want to just return a list of my friends that are tagged in a photo, ignoring events, groups and users that aren't my friend.

Does anyone know why this returns 0 results?

SELECT subject, xcoord, ycoord, text
FROM photo_tag
WHERE object_id = [PHOTO_OBJECT_ID] 
AND subject IN (SELECT uid2 FROM friend WHERE uid1 = me())

Even though...

SELECT subject, xcoord, ycoord, text
FROM photo_tag
WHERE object_id = [PHOTO_OBJECT_ID] 

Returns a list of users which includes friends of mine, verified by...

SELECT uid2 FROM friend where uid1 = me() and uid2 = [SUBJECT_USER_ID]

Upvotes: 0

Views: 98

Answers (1)

Michael Waterfall
Michael Waterfall

Reputation: 20569

Apparently this is "by design"!

Facebook's response:

This is by design, after you have the list of subjects, you can query the user table to see if that subject is a user.

https://developers.facebook.com/bugs/549553255066877

Upvotes: 0

Related Questions