I'm in the process of migrating from the 2.x PHP SDK to 3.x. All of the multiquery calls are broken and I haven't been able to figure out how to resolve.
The facebook connect login using oauth javascript works and allows data for the current user to be accessed server side. I assume this verifies my access token is legit.
I've tried the following code variations and get errors each time:
Old way:
$id = $fb->getUser(); // RETURNS A VALID USER ID
$fql = '{ "friends" : "SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 = '.$id.')", "profiles" : "SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT uid FROM #friends)"}';
$response = $fb->api( array('method' => 'fql.multiquery','queries' => $fql));
Gives the error: PHP Fatal error: Uncaught Exception: 102: Requires user session\n thrown
Assumed New Way of doing it:
$id = $fb->getUser(); // RETURNS A VALID USER ID
$fql = '{ "friends" : "SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 = '.$id.')", "profiles" : "SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT uid FROM #friends)"}';
$response = $fb->api( array('method' => 'fql.query','query' => $fql));
Gives the error: PHP Fatal error: Uncaught Exception: 601: Parser error: unexpected '{' at position 0
Any help understanding how to do a multiquery using the new PHP SDK is appreciated.