O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving a User’s Pages

Problem

I need to retrieve all of the Pages a specified user is a fan of using FQL.

Solution

SELECT name, type, pic_square FROM page WHERE page_id IN
 (SELECT page_id FROM page_fan WHERE uid = $user);

Discussion

You’ll get an empty set if the current loggedinuser doesn’t have permission to see the Pages of the user you’re querying on.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required