Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7970313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:22:45+00:00 2026-06-04T07:22:45+00:00

I have been working on trying to pull friends birthdays from the facebook API

  • 0

I have been working on trying to pull friends birthdays from the facebook API and I have been able to pull my friends uid’s but when I replace the uid request with anything else (i.e, name,sex,birthday, etc.) it breaks the code. Any insight would be a major help. Thanks

 <div id="fb_login"> 

             <div id="fb-root"></div>
          <script>
            window.fbAsyncInit = function() {
              FB.init({
                appId      : 'APP_ID',
                status     : true, 
                cookie     : true,
                xfbml      : true,
                oauth      : true,
              });
            };
            (function(d){
               var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
               js = d.createElement('script'); js.id = id; js.async = true;
               js.src = "//connect.facebook.net/en_US/all.js";
               d.getElementsByTagName('head')[0].appendChild(js);
             }(document));
          </script>
        <div class="fb-login-button" scope="user_birthday,friends_birthday">Login with Facebook</div>



      <div id="bday_display">
      <?php
                $app_id = 'APP_ID';
                $app_secret = 'APP_SECERT';
                $my_url = 'MY_URL';


                $code = $_REQUEST["code"];



               //auth user
               if(empty($code)) {
                  $dialog_url = 'https://www.facebook.com/dialog/oauth?client_id=' 
                  . $app_id . '&redirect_uri=' . urlencode($my_url) ;
                  echo("<script>top.location.href='" . $dialog_url . "'</script>");
                }

                //get user access_token
                $token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
                  . $app_id . '&redirect_uri=' . urlencode($my_url) 
                  . '&client_secret=' . $app_secret 
                  . '&code=' . $code;
                $access_token = file_get_contents($token_url);

                // Run fql query
                $fql_query_url = 'https://graph.facebook.com/'
                  . '/fql?q=SELECT+uid2+FROM+friend+WHERE+uid1=me()'
                  . '&' . $access_token;
                $fql_query_result = file_get_contents($fql_query_url);
                $fql_query_obj = json_decode($fql_query_result, true);



                //display results of fql query
                echo '<pre>';
                print_r("query results:");
                print_r($fql_query_obj);
                echo '</pre>';





              ?>

    </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:22:47+00:00Added an answer on June 4, 2026 at 7:22 am

    Here is the code that worked. Thanks for all your help cpilko. I couldn’t have got it done with out your help.

            try{
                $fql    =   "SELECT name, birthday_date FROM user WHERE uid IN (SELECT uid2          FROM friend WHERE uid1=me())";
                $param  =   array(
                     'method'    => 'fql.query',
                    'query'     => $fql,
                    'callback'  => ''
                );
                $fqlResult   =   $facebook->api($param);
            }
            catch(Exception $o){
                d($o);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have been working and trying for a couple of hours. I am
I have been working on mvc3 application and trying to localize the same. I
I have been working on this problem for a while now. I am trying
I have been working on this for 24 hours now, trying to optimize it.
Hi I have been working on a solution for days, and I've been trying
I have been trying for 4 days to get app-engine and grails working together
I have been trying to get a USB HID keyboard working on an Android
I have been trying to get the FTDI D2xx driver working with my Android
I have been going mad trying to figure out why my scripts weren't working,
I am working on a little WinForm app and have been trying to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.