List Friends Facebook API


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.