Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9123133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:15:56+00:00 2026-06-17T06:15:56+00:00

As the subject says, I am trying to get the most recent comments from

  • 0

As the subject says, I am trying to get the most recent comments from a Facebook page, with associated user data. I am using Open Graph & the PHP SDK.

This works fine for the posts:

$fql_query = "
    SELECT fromid, id, post_id, time, text  
    FROM comment  
    WHERE post_id IN (SELECT post_id FROM stream WHERE source_id = '" . $fb_id . "') 
    ORDER BY time DESC LIMIT 1000";

$feed = $facebook->api(array(
    'method' => 'fql.query',
    'query' => $fql_query
    ));

And this is how to get the user details I need:

$fql_query = "
    SELECT pic_square, name  
    FROM user 
    WHERE uid = '" . $user_id . "'
    ";

And, according to everything I can find, this should combine the two using fql.multiquery:

$fql_queries = "{
    \"query1\" : \"
    SELECT fromid, id, post_id, time, text 
    FROM comment 
    WHERE post_id IN (SELECT post_id FROM stream WHERE source_id = '" . $fb_id . "') 
    ORDER BY time DESC LIMIT 1000
    \", 
    \"query2\" : \"SELECT pic_square, name FROM user WHERE uid IN (SELECT fromid FROM #query1)\"
    }";

$feed = $facebook->api(array(
    'method' => 'fql.multiquery',
    'queries' => $fql_queries
    ));

But it just returns an empty array. Does anyone know where I’m going wrong or have a better method to do what I require? TIA, as always.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:15:57+00:00Added an answer on June 17, 2026 at 6:15 am

    I tested this in the Graph API explorer on one of my pages and it works fine.

    Does this multiquery work on your page in the Graph API explorer? If yes, then it’s a permissions issue.

    Perhaps your issue is in the way you’re hard-coding the json. I use syntax like this on my site. (It’s more readable too):

    $fql_queries = array(
       'query1' => "SELECT fromid, id, post_id, time, text...",
       'query2' => "SELECT pic_square, name FROM user..."
    );
    
    ...
        'queries' => json_encode($fql_queries)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think the subject says it all, I'm trying to open a console (really
The subject says it all. Trying to see if I can't change that loading
The subject line says it all. I'd also like to do this using pipes.
As the subject says, I'm posting events from non-GUI thread (some GStreamer thread, to
Here's one from the No question's too dumb department: Well, as the subject says:
As the title says I'm trying to get a simple email working with Heroku
I am trying to use the below code to send email from asp.net(C#). using
As the subject says, I'm trying to come up with a good way of
Subject says it all really...Is there anywhere a good tutorial for Xcode's Debugger out
The subject says it all, really. Documentation, insofar as it exists at all, suggests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.