I noticed that several fql tables have an object_id as well as a regular id. For instance, the photo table has both the object_id and a pid. What is the difference between the two?
Also, you can append the object_id to www.facebook.com/ to use as a link to the actual picture in facebook.
Related
it is possible to use the familiar SQL LIKE operator within Facebook's query language?
$fql = 'select fromid, text from comment where object_id in (select comments_fbid from link_stat where url LIKE "%youtube%") ORDER BY time DESC limit 5';
According to their documentation, there is no such feature: https://developers.facebook.com/docs/technical-guides/fql/
I'm trying to get the photos of a Facebook album ordered by like count in FQL with a this query:
SELECT like_info, object_id FROM photo WHERE aid="xxxxxxxxxx_xxxx" ORDER BY like_info.like_count desc
But I get an error (#602) like_count is not a member of the like_info scalar.
SELECT like_info, object_id FROM photo WHERE aid="xxxxxxxxxx_xxxx" ORDER BY like_info desc
Does the trick, but I don't know why: isn't *like_info* an object? it is possible to order a query using a member of an object?
Just use ORDER BY like_info. Don't forget to put LIMIT, otherwise query might crash for large number of pics:
SELECT like_info, object_id FROM photo WHERE aid="20531316728_324257" ORDER BY like_info desc LIMIT 10
Run in Facebook API explorer
SELECT object_id, src_small FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = me())ORDER BY created DESC LIMIT 1
in the example me() can be replaced with any friend_id , order by "created" is also posible
I am looking for a way to declare friend_id's as array and avoid using fql.multiquery (very slow and got timeouts using node.js)
Thanks
I am writing a fql as below.
fql='SELECT caption, owner, pid, src_big, created FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner IN (11111) ) LIMIT 1,5';
The problem is: how to write one fql to get the owner name also?
Thanks.
You may get owner name by joining the two tables photo and album. I am not sure how your table columns are but i suppose you must have an pid in album table so you can link tables likes this.
SELECT caption, owner, pid, src_big, created FROM photo LEFT JOIN album ON photo.pid=album.pid where aid IN (11111) LIMIT 1,5
I'm having a hard time running this FQL query.
SELECT pid, src_big FROM photo WHERE pid
IN (SELECT pid FROM photo_tag WHERE subject=me())
The photo_tag table returns a pid that is a much longer string than the usual photo pid.
The inner SELECT statement returns the right number of tagged photos. However, I'd like to get more info on those photos. Any ideas?
which info do you need? if you want more infos, here is the full list of data you can get from the photo table:
http://developers.facebook.com/docs/reference/fql/photo/
about the pid: yes, that is not the "real" photo id. i think you have to select the column "object_id" for the real id.
"The pid is unique only for a given user." - so you cannot really work with it anyway, i guess.
just include those columns from my link you need, like this:
SELECT pid, src_big, object_id FROM photo...