私は大学の最終学年のコンピューティングの学生で、プログラミングの経験はほとんどありません。1 人の Facebook ユーザーがログインしたときにすべての Facebook イベントを一覧表示しようとしていますが、以下の配列はエラーなしで空に戻ります。
<h1>events</h1>
<?php
$me='MY-FACEBOOK-ID';
$accesstoken='MY-ACCESS-TOKEN';
//include the Facebook PHP SDK
include_once 'facebook-php-sdk-master/src/facebook.php';
//instantiate the Facebook library with the APP ID and APP SECRET
$facebook = new Facebook(array(
'appId' => 'MY-APP-ID',
'secret' => 'MY-FACEBOOK-SECRET',
'cookie' => true));
$user= $facebook->getUser();
$user_profile=$facebook->api('/me');;
print$user;
$multiQuery = '{
"attending":"SELECT name, start_time, end_time, location, description FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = '.$user.' AND rsvp_status=\'attending\')",
"maybe":"SELECT name, start_time, end_time, location, description FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = '.$user.' AND rsvp_status=\'unsure\')",
"declined":"SELECT name, start_time, end_time, location, description FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = '.$user.' AND rsvp_status=\'declined\')",
"not_replied":"SELECT name, start_time, end_time, location, description FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = '.$user.' AND rsvp_status=\'not_replied\')",
}';
$param = array(
'method' => 'fql.multiquery',
'queries' => $multiQuery,
'callback' => '');
try{
$events = $facebook->api($param);
var_dump($events);
$event2=$facebook->api("/$user/events?limit=1000");
var_dump($event2);
}catch(Exception $e){echo $e->getMessage();}
?>