I need to retrieve some (or all) of the albums for a specific user from the Facebook Photos app using FQL.
The simplest form of this query is:
SELECT aid, cover_pid, name, link FROM album WHERE owner = $uid LIMIT 5;
When you’re imposing a limit on the data that gets returned, you
might want to add an
clause so that you’re getting some logical subset. With the case of
something like albums, it might
make sense to get the five albums most recently updated by a
SELECT aid, cover_pid, name, link, modified FROM album WHERE owner = $uid ORDER BY modified DESC LIMIT 5;
DESC added to the
ORDER BY when using a timestamp as
the ordering field will give you results in reverse chronological
order (i.e., newest first).