For an Android app, I’m trying to get some info of a specific user (using its user id) on Facebook using FQL, and also get a high quality image of the user.
This means I have to use both the “user” table and the “photo” table.
Currently, the queries are:
SELECT first_name, last_name, status, current_location, uid, pic_square, pic_big, website, work, email, contact_email, current_location, sex, birthday_date
FROM user
WHERE uid in (%s) order by name
SELECT src_big,owner
FROM photo
WHERE aid IN (SELECT aid FROM album WHERE owner=%s AND type=\"profile\") LIMIT 1
The first one returns all of the info of the specified users, and the second one returns the src_big of a single user. Is it possible to do inner join and do them both in a single query?
EDIT:
It seems that inner join is still impossible for FQL. However, I still wish to ask something about this: how do I change the second FQL statement to show multiple results, as used in the first FQL statement?
Yes, an FQL multiquery doesn’t give you the ability to select one item per user in the result. Your second query will give you just one item. You would need to get all photos from all users in FQL and then filter them in your app, or make a separate API call per user.
You can do this with the Graph API using field expansion. Your query endpoint will be:
Since you’re using the
fieldsparameter, you will need to individually declare each field you want in your result.