开发者

Does Facebook friends sequence remains same while using FQL?

I am using FQL to get the list of friends

$fql = sele开发者_如何学Goct uid, name, work_history, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER_ID);

does this query returns same friend sequence all the time or it is different in few cases.

suppose list returns : Friend1,friend2,friend3 .... etc

So does it return the same sequence all the time or not?

Please let me know if any further detail required or if the problem is not clear.

-deepak


I'd take all doubt out of the equation and just add an ORDER BY:

SELECT uid, name, work_history, education_history, current_location 
FROM user 
WHERE uid IN (select uid2 from friend where uid1=<FACEBOOK_USER_ID>) 
ORDER BY uid


It appears that they come back in sequential order based on the user id. So if you had three friends with the user ids 111111, 222222, and 3333333, they would be returned in that order.

With THAT said, I wouldn't rely on this behavior. Even if it never changes, it is probably bad practice to assume it will always be that way. It's a much better practice to get the data, then order it on your end to your needs. That way you know it is always in the order you want even if the ordering on Facebook's end changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜