-2

尝试创建一个 facebook 应用程序只是为了学习并遇到一个我不知道该怎么做的奇怪现象。

我了解所有的 JSON 转换,但似乎我一次不能查询超过 2 个 facebook 值,而我应该能够......(???抱歉,如果那是混淆)。下面是我断章取义的代码。

$query="query".$i;
$idarray["$query"]="SELECT+pic,name+FROM+user+WHERE+uid=".$friend_id[$i];

当我尝试查询的不仅仅是图片和名称时,它只给了我两个。它不会让我查询诸如“图片、姓名、用户名”之类的内容。有人知道原因吗?如果是这样,我该如何解决这个问题以查询超过 2 个?

先感谢您!

4

1 回答 1

0

这对我来说很好,我无法确定你在做什么导致它不起作用:

select uid, name, first_name, middle_name, last_name, sex, locale, pic_small_with_logo, pic_big_with_logo, pic_square_with_logo, pic_with_logo, username from user where uid in (4,5,6,7)

回报是:

{
  "data": [
    {
      "uid": 4, 
      "name": "Mark Zuckerberg", 
      "first_name": "Mark", 
      "middle_name": "", 
      "last_name": "Zuckerberg", 
      "sex": "male", 
      "locale": "en_US", 
      "pic_small_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQDIpcVgo2Fz4U4e&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F157340_4_3955636_t.jpg&logo&v=5", 
      "pic_big_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCa1XUcpDZryPMM&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F49942_4_1525300_n.jpg&logo&v=5", 
      "pic_square_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBYWqMD88h5CkD3&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F157340_4_3955636_q.jpg&logo&v=5", 
      "pic_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQDqZdUCq_U_senP&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F157340_4_3955636_s.jpg&logo&v=5", 
      "username": "zuck"
    }, 
    {
      "uid": 5, 
      "name": "Chris Hughes", 
      "first_name": "Chris", 
      "middle_name": "", 
      "last_name": "Hughes", 
      "sex": "male", 
      "locale": "en_US", 
      "pic_small_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBm5Un8ZmN8OMxy&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F211833_5_64370680_t.jpg&logo&v=5", 
      "pic_big_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQB0gVdhHSj4v6gN&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F211833_5_64370680_n.jpg&logo&v=5", 
      "pic_square_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBTEKDI6lBvbtcE&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F211833_5_64370680_q.jpg&logo&v=5", 
      "pic_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCYybISnGDBbBfO&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F211833_5_64370680_s.jpg&logo&v=5", 
      "username": "ChrisHughes"
    }, 
    {
      "uid": 6, 
      "name": "Dustin Moskovitz", 
      "first_name": "Dustin", 
      "middle_name": "", 
      "last_name": "Moskovitz", 
      "sex": "male", 
      "locale": "en_US", 
      "pic_small_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAq87DIy_gbhxVb&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F173132_6_1123895199_t.jpg&logo&v=5", 
      "pic_big_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBtlc6qP74cEMpQ&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F173132_6_1123895199_n.jpg&logo&v=5", 
      "pic_square_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAumnkA5BT4KUVk&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F173132_6_1123895199_q.jpg&logo&v=5", 
      "pic_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBJZfp6ui5GWXRZ&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F173132_6_1123895199_s.jpg&logo&v=5", 
      "username": "moskov"
    }, 
    {
      "uid": 7, 
      "name": "Arie Hasit", 
      "first_name": "Arie", 
      "middle_name": "", 
      "last_name": "Hasit", 
      "sex": "male", 
      "locale": "en_US", 
      "pic_small_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAVKTiIJr8Yf9KR&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F23251_7_6318_t.jpg&logo&v=5", 
      "pic_big_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQDonksAfqN0W_GS&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F23161_7_4183_n.jpg&logo&v=5", 
      "pic_square_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAP10kv_ZDVA6XF&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F23251_7_6318_q.jpg&logo&v=5", 
      "pic_with_logo": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCL96KpL_7TLRar&url=https\u00253A\u00252F\u00252Ffbcdn-profile-a.akamaihd.net\u00252Fhprofile-ak-snc4\u00252F23251_7_6318_s.jpg&logo&v=5", 
      "username": "arie.hasit"
    }
  ]
}
于 2012-06-15T06:58:32.310 回答