2011-10-18 55 views
0

我使用這個查詢爲什麼結果我得到的所有的朋友,而不是隻10friends

$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in ('.implode(", ", $man).')'; 

獲得UID,pic_squre和10friends的性別,其是由用戶 選擇和他們的用戶ID存儲在$ man []一個數組

但是當我看到結果它是選擇一個用戶的所有朋友而不是朋友 只有用戶選擇 什麼是錯的?

這是我得到的所有朋友

[12] => Array 
      (
       [uid] => 100003033556875 
       [sex] => female 
       [pic_square] => http://profile.ak.fbcdn.net/hprofile-ak-snc4/274747_1000 

03033556875_306033850_q.jpg 
    ) 
+0

這些都是$男子值 100002131686032,1602023867,100000297352382,100000501703505,1257699872,100003033556875 ,100002474721536,1075440919,10000001676304188,100000925253290 –

+0

我剛剛試過你的查詢,它工作正常:https://developers.facebook.com/tools/explorer?method=GET&path=fql%3Fq%3DSELECT%20uid%2C%20sex%2C %20pic_square%20FROM%20user%20 WHERE%20uid%20in%20(100002131686032%2C%201602023867%2C%20100000297352382%2C%20100000501703505%2C%201257699872%2C%20100003033556875%2C%20100002474721536%2C%201075440919%2C%20100001676304188%2C%20100000925253290)%3B –

回答

-1

您應該添加LIMIT子句

$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in ('.implode(", ", $man).') LIMIT 10'; 
+0

添加'LIMIT'子句將會得到10,但是從我的理解來看,OP將10個Facebook用戶添加到數組中,所以它應該只返回10條記錄。 –

+0

嘗試LIMIT它仍然給我所有的結果,爲什麼我在$ man數組中獲得所有結果只有10個值與朋友ID? –

+0

@NeilKnight是的,這就是我說的是它將所有結果返回給我? –

相關問題