Reputation: 183
I use this query:
SELECT pid FROM photo WHERE owner=$friend_id;
It works fine, but for some users(that has more than 1 photo) this query returns only 1 record.
Then i tried this query:
SELECT pid FROM photo WHERE owner=$friend_id LIMIT 10;
But returned result is the same - only 1 record.
Permissions :
user_activities,
user_photos,
friends_activities,
friends_photos,
publish_stream
What i have to do to get correct result for anyone user??
Upvotes: 1
Views: 165
Reputation: 38115
This depends on the friend's privacy settings for the albums and photos he/she shares/uploads.
Also, I noticed that the owner
field in the photo
table is not indexable but it is in the album
table and hence you may need to use something like:
SELECT pid FROM photo WHERE owner = XXXXXX AND aid IN (
SELECT aid FROM album WHERE owner = XXXXXX
)
Upvotes: 1