Now I am moving from 2.x PHP SDK to 3.x. All multiquery calls are broken, and I could not figure out how to solve them.
Facebook connects to the login using oauth javascript and allows you to access data for the current user on the server side. I assume this confirms that my access token is legal.
I tried the following code options and got errors every time:
Old way:
$id = $fb->getUser();
$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 error: PHP Fatal error: Uncaught Exception: 102: User session required \ n thrown
The supposed new way to do this is:
$id = $fb->getUser();
$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 an error: PHP Fatal error: Not available Exception: 601: Error Parser: unexpectedly '{' at position 0
Any help on understanding how to do multiple instances using the new PHP SDK is appreciated.