-1
我想從當前日期到下一年的當天取Facebook生日。 todate是364天后到現在m/d的日期。爲此,第一個fql將從jan檢索數據到當前日期,第二個是將數據從當前日期提取到31 dec。我想爲未來11個月和29天的即將到來的生日應用分頁。以下查詢正在工作並提取數據。任何人都可以告訴我這樣做的最佳方式。任何建議將不勝感激。facebook即將到來的生日只會在今年提取
$fromDate = date('m/d');
$past_birthdays = $facebook->api(array(
'method' => 'fql.query',
'query' => "SELECT uid, name, birthday, birthday_date,substr(birthday_date,0,3) FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND birthday_date<'$toDate' AND birthday_date>='01/01' order by birthday_date",
'access_token' => $accessToken
));
if ($toDate > $fromDate) {
$condition = " AND birthday_date<'$toDate'";
} else {
$condition = "";
}
$upcoming_birthdays = $facebook->api(array(
'method' => 'fql.query',
'query' => "SELECT uid, name, birthday, birthday_date,substr(birthday_date,0,3) FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND birthday_date>='$fromDate' $condition order by birthday_date",
'access_token' => $accessToken
));