English 中文(简体)
FQL - 查阅Facebook用户册和图片数目
原标题:FQL - Getting Facebook user Album Covers and number of pictures

能否得到所有用户的复印件+每一册的图片数量?

我可以通过:

SELECT aid, pid, src_small, src, src_big FROM photo WHERE aid IN(SELECT aid FROM album WHERE owner=me()

but I want to get also how many pictures in each album。。。。

我可以操作一个“Loop”所有用户集,而“FQL”则每个集都有另一个“FQL”,但是,如果能够以更好的方式更快/更高效地做到这一点,我会ander。

任何建议?

Thanks, Gtamir

问题回答
    function getAlbum() {
FB.api( /me/albums , function(resp) {
    console.log( Albums , resp);
    var ul = document.getElementById( albums );
    for (var i=0, l=resp.data.length; i<l; i++) {
      var
        album = resp.data[i],
        li = document.createElement( li ),
        span = document.createElement( span ),
        a = document.createElement( a );

      a.innerHTML = album.name;
       span.innerHTML = album.count;
      li.appendChild(a);
      li.appendChild(span);
      ul.appendChild(li);
    }
  });

}

每一册的样本都有“album”表“photo_count”财产,因为你需要“photo”表格的照片资料,而FQL不支持加入表格,你唯一的捕获量是使用多频率。

$multiQuery = {
 "query1":"SELECT aid,owner,name,photo_count,type,object_id FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me())",
 "query2":"SELECT aid, pid, src_small, src, src_big FROM photo WHERE aid IN(SELECT aid FROM album WHERE owner=me())"
 };

$param = array(       
  method  =>  fql.multiquery ,       
  queries  => $multiQuery,       
  callback  =>   );

$queryresults = $facebook->api($param);

我先亲自测试了该守则,但应该这样做。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签