0
Staff need to run a simple FQL using Facebook SDK PHP 4 using the following command:
$result=(new FacebookRequest( $session, 'GET', $fql))->execute()->getGraphObject()->asArray()
and it generates me the following error:
Fatal error: Uncaught Exception 'Facebook Facebookauthorizationexception' with message '(#12) fql is deprecated for versions v2.1 and Higher'
I read that this kind of command is really outdated, but I couldn’t find anything to replace it.
As it is now in this new API 2.x?
I have this code I found.
$fql="/fql?q=SELECT uid, name,pic_square, birthday_date FROM user WHERE (substr(birthday_date, 0, 2) = '07') AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) order by name&access_token=".$_SESSION["token"];
$session = $this->login();
$result=(new FacebookRequest( $session, 'GET', $fql))->execute()->getGraphObject()->asArray();
How would I use it in the new API.
João, we are in the same boat. Some FQL features have no direct counterpart in the Graph API (e. g., see this my question). Unfortunately, with the date of April 30th knocking on the door, we either migrate for good or we migrate for bad. I recommend that you take a look at Graph API services and try to replace your FQL commands in the best possible way.
– Anthony Accioly
I really need to list the day’s birthday so I can send him a message. I just saw how to do this using FQL. Do you know somehow for this? Thank you
– Joao Nivaldo
I do not know exactly what is your use case (if you want to post your FQL and expected return), however, I know with permission
user_birthday
you can consult a user’s birthday with the call:{id_do_usuario}?fields=birthday
. For more information see: https://developers.facebook.com/docs/graph-apice/v2.2/user– Anthony Accioly
So what I need is to develop a PHP site that accesses my facebook page and takes all the friendly menus that are birthday on the day and sends a generic message to them. I’ve already managed to list all the friends, now I have to find out which ones have a birthday and how to send a message to them. If you can help me Graduate.
– Joao Nivaldo
Pole one mvce showing your problem. So you get more specific and targeted help.
– Anthony Accioly
I have this code I found. $fql="/fql? q=SELECT uid, name,pic_square, birthday_date FROM user WHERE (substr(birthday_date, 0, 2) = '07') AND uid IN (SELECT uid2 FROM Friend WHERE uid1 = me()) order by name&access_token=". $_SESSION["token"]; $Session = $this->login(); $result=(new Facebookrequest( $Session, 'GET', $fql))->execute()->getGraphObject()->asArray(); .
– Joao Nivaldo