Posted By

jretamal on 08/10/11


Tagged

php facebook friends


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

boksiora


List Friends Facebook API


 / Published in: PHP
 

  1. <?php
  2. include("libs/fbmain.php");
  3.  
  4. //Hacemos una consulta a la BBDD de facebook por medio de FQL
  5. $fqlAmigos= "select uid, name, pic_square from user where uid in (SELECT uid2 FROM friend WHERE uid1 = ".$uid.") order by name asc";
  6. $paramAmigos = array(
  7. 'method' => 'fql.query',
  8. 'query' => $fqlAmigos,
  9. 'callback' => ''
  10. );
  11. $fqlResultAmigos= $facebook->api($paramAmigos); //Variable con el resultado de la consulta FQL
  12.  
  13. //Recorremos los resultados.
  14. foreach($fqlResultAmigos as $key => $val)
  15. {
  16. echo $val[uid]; //UID
  17. echo $val[name]; //NAME
  18. }
  19. ?>

Report this snippet  

You need to login to post a comment.