Created
January 4, 2012 18:11
-
-
Save ScottPhillips/1561267 to your computer and use it in GitHub Desktop.
Using the PHP SDK to run FQL queries using the Facebook Graph API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$facebook = new Facebook(array( | |
'appId' => 'YOUR_API_KEY', | |
'secret' => 'YOUR_API_SECRET', | |
'cookie' => true, | |
)); | |
$fql = "SELECT page_id, name from page where name='Coke'"; | |
$response = $facebook->api(array( | |
'method' => 'fql.query', | |
'query' =>$fql, | |
)); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$param = array( | |
'method' => 'fql.query', | |
'access_token' => $cookie['access_token'], | |
'query' => $fql, | |
'callback' => '' | |
); | |
$response = $facebook->api($param); | |
print_r($response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please allow me to reuse the code you shared? house of hazards