Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing FQL to retrieve only upcoming birthdays from Facebook API
    primarykey
    data
    text
    <p>Using the <a href="http://developers.facebook.com/docs/reference/fql/" rel="nofollow">information on FQL</a> and <a href="http://developers.facebook.com/docs/reference/fql/user/" rel="nofollow">the user table</a> from Facebook's Developer's docs, I've come up with the following code. </p> <pre><code> //build fql string $fql = "SELECT name, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND strlen(birthday_date) != 0 AND substr(birthday_date,0,3) IN ('{$currentMonth}/', '{$nextMonth}/')"; $fql.=$orderBy; $fql.=" LIMIT " . $limit; //query facebook $params = array( 'method' =&gt; 'fql.query', 'query' =&gt; $fql, 'callback' =&gt; '' ); $birthdays = $this-&gt;facebook_obj-&gt;api($params); </code></pre> <p><code>$currentMonth</code> and <code>$nextMonth</code> are set to string representations of the current month and next month respectively, in mm format. (eg "09", "10" etc.) </p> <p>This is "working", but let's say that today is November 29th, I have 20 friends with birthday's in November and <code>$limit</code> is set to 10. In this case, there is a very good chance that the 10 birthdays it returns will all be before November 29th.</p> <p>What I would really like to do is get upcoming birthdays from today's day out, for this month and next. How could I modify this query to accomplish that? </p> <p>Thanks!</p> <p>*<em>*</em> Edit, see comment thread between Shawn and I for possible alternative solutions. No answer accepted yet as none directly addresses original code / question.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload