1

所以我有一个基本的 FQL 查询,可以拉出所有用户的朋友:

$fql = "SELECT name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me())";

我需要能够根据他们的学校缩小返回用户的范围。我知道你可以做这样的查询:

$fql = "SELECT name FROM user WHERE sex='male' AND uid IN (SELECT uid1 FROM friend WHERE uid2=me())";

那只会返回男性朋友。无论如何要添加另一个子句,例如:

AND WHERE sex='male'

除非他们信息中的学校 ID 与其他 ID 相同。我已经要求用户授予我 friends_education_history 权限,所以这应该是一个问题。我正在尝试做的是只拉出特定大学的朋友并展示他们。

我也知道教育信息是一个数组。看起来像这样:

( [id] => 103767646329157 [name] => Savannah Country Day School ) [year] => Array ( [id] => 137616982934053 [name] => 2006 ) [type] => High School ) [1] => Array ( [school] => Array ( [id] => 110256772337516 [name] => American University Center of Provence ) [type] => College ) [2] => Array ( [school] => Array ( [id] => 12527153330 [name] => University of Virginia ) [year] => Array ( [id] => 142963519060927 [name] => 2010 ) [concentration] => Array ( [0] => Array ( [id] => 154992221223448 [name] => English ) ) [type] => College ) ) )

我可以在 type= College 的地方提取信息吗?

提前致谢

4

1 回答 1

4

SELECT name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) AND 'Utah' IN affiliations

这将吸引网络“犹他”(犹他大学)中的所有朋友。

于 2011-07-19T13:05:34.143 回答