0

I have this code:

//Create Query
$params = array(
    'method' => 'fql.query',
    'access_token' => '$user->accessToken',
    'query' => "SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = XXXXXXXX)",
);

//Run Query
$result = $facebook->api($params);

var_dump($result);

When i run the script containing above code, I don't get any result. Rather, i get the error Maximum execution time exceeded. I have confirmed that the query is ok by checking it in Graph API Explorer. Moreover, I have also confirmed (by debugging) that the $user->accessToken contains correct access token with all the permissions given by user.

I have also tried using urlencode with my query string as well... without any success.

What am i doing wrong here?

1
  • Simple - when you ask a question, if somebody answers it and you feel it is the correct answer, make mark it as such by clicking the checkmark to the upper-left of the question. Commented Jan 7, 2013 at 23:03

1 Answer 1

1

You're single-quoting your access token reference.

'access_token' => '$user->accessToken',
                 ^^^                ^^^

That sets the value to, literally $user->accessToken. Change the right-side quotes to double quotes (or better yet, remove them altogether).

Cheers

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for pointing that out, but my my original problem turned out to be the proxy-and-curl problem which i have solved. Now, I am getting Facebook's Invalid API key exception. Do u know anything regarding it?
check the app_id and app_secret that you have provided in your $facebook variable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.