Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FQL - Getting pid of the photos user is tagged in gives different results with different query

I am trying to get the photos a user is tagged in. I am using the query:

SELECT pid 
FROM photo 
WHERE pid 
IN (SELECT pid FROM photo_tag WHERE subject=me())

The number of results I get is 32. However when I run this query:

SELECT pid FROM photo_tag WHERE subject=me()

The number of results I get is 67. This is the number I expect because I am tagged in 67 pictures, not just 32. What am I doing wrong with the query?

like image 606
Malolan Santhanakrishnan Avatar asked Jan 05 '12 04:01

Malolan Santhanakrishnan


2 Answers

It's possible that you're tagged in photos that are not accessible using the current access_token. Take one of the photo ids from the larger list that you don't see on the smaller list and try accessing it using that access_token.

like image 74
DMCS Avatar answered Sep 30 '22 13:09

DMCS


photo_tag table contains photos in which your are tagged, photo table contains photo uploaded by you

In your situation, you are tagged in 67 photos, and 32 out of 67 photos are uploaded by you, the others are uploaded by someone else (and you're tagged).

like image 30
Hieu Vo Avatar answered Sep 30 '22 15:09

Hieu Vo