Calculating MySQL Age from Date of Birth Column and Selecting Records Between Age Range

While developing a Facebook Dating app recently, I needed to return records for a date range between minimum and maximum age from users table but the data was in the date format (birthday). Following select command will calculate the age from the `birthday` column value for you for each record: SELECT EXTRACT(YEAR FROM (FROM_DAYS(DATEDIFF(NOW(),`birthday`))))+0 AS…

Get Facebook User’s Affiliations, Network Information Using Facebook Graph API

Facebook Graph API $me object does not provide user’s network info. To access FB user’s networks/affiliations information, you need to use FQL like this: $fql = ‘SELECT affiliations, name FROM user WHERE uid = ‘.$me[‘id’]; //or use this query for standard_user_info table //$fql = ‘SELECT affiliations, name FROM standard_user_info WHERE uid = ‘.$me[‘id’]; $param =…

Facebook Application Development with Graph API Cookbook

With Facebook user base reaching 1 Billion connected people mark and integration of more than 7 million websites, Facebook is the number one social networking platform. While every developer wants to be on this bandwagon to create applications and games, there are numerous tutorial websites sharing the tips and tricks on Facebook evolving API. For…

Facebook Graph API 3.1 – Requesting Extended Permissions for your Application

Facebook has added the app’s permissions to the user object, which can easily be accessed using Facebook Graph API and any specific permission is missing, you can request for it by redirecting user to the Facebook: $app_id =’App ID here’; $app_secret =’App Secret here’; $app_url =’App URL here’; // Create our Application instance. $facebook =…

What is Facebook Third Party ID and How to Get it using Graph API

To get the Facebook Third Party ID for your app Facebook user, try the following code using Graph API: $fbid = $facebook->api(‘/me?fields=third_party_id&access_token=’.$access_token); echo “THIRD PARTY ID: “.$fbid[‘third_party_id’]; What is Third Party ID? Facebook expressly prohibit Platform developers from passing any data from Facebook to data brokers. But sometimes there are practical reasons that developers will…

Resolve Facebook “App temporarily unavailable Runtime errors” & FBJS Errors

If you are getting “App temporarily unavailable” FBJS errors like following on your Facebook apps pages: App temporarily unavailable Runtime errors: URLExceptionInvalid scheme for url (javascript:) URLExceptionInvalid scheme for url (javascript:void(null)) Solution Search in your html code any reference to javascript in a href=”javascript:” tags. Just remove them and use onClick event instead. Hope that…