Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/01/2013, 01:34
DoHITB
 
Fecha de Ingreso: abril-2012
Ubicación: 41°37′00″N, 00°37′00″E
Mensajes: 462
Antigüedad: 12 años, 1 mes
Puntos: 33
Problema con FQL para PHP

Buenas!

Ayer estuve lidiando con la API de FB para PHP, y me he encontrado con un problema que no se como resolver...

Tengo todo configurado, los persmisos user_events y friend_events, sin embargo una consulta no me funciona...

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
  4. <head>
  5.         <meta property="og:title" content="This Page Title"/>
  6.         <meta property="og:url" content="miweb.com"/>
  7.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8.     <meta http-equiv="Content-Language" content="en" />
  9.     <meta name="GENERATOR" content="PHPEclipse 1.2.0" />
  10.     <title>title</title>
  11. </head>
  12. <body>
  13. <?php
  14. $f = new Facebook($config); //la config está bien
  15. $user_id = $f->getUser();
  16.  
  17. if($user_id){
  18.     try{
  19.         $ret = $f->api(array('method' => 'fql.query',
  20.                                                                      'query' => 'select eid, uid, rsvp_status
  21.                                                                                       from event_member
  22.                                                                                       where uid = '.$user_id.';'));
  23.         print_r($ret);
  24.     }catch(FacebookApiException $e){
  25.         $login_url = $f->getLoginUrl();
  26.         echo('Please, <a href="'.$login_url.'">log in</a>');
  27.         echo('<hr />');
  28.         print_r($e->getType());echo(' ');
  29.         print_r($e->getMessage());
  30.     }
  31. }else{
  32.     $login_url = $f->getLoginUrl();
  33.     echo('Please, <a href="'.$login_url.'">log in</a>');
  34. }
  35. ?>

Y me devuelve un array vacío...

Sin embargo, si hago otra consulta, como "select name from user where uid = $user_id", sí funciona

¿Qué estoy haciendo mal?¿Qué falla?

En la herramienta de debug de FQL me funciona el select...

Gracias