2011-06-15 78 views
0

我使用此功能從facebook相冊中獲取照片。請給出建議爲什麼它返回空格。使用FQL和Javascript SDK從Facebook相冊獲取照片時出錯

function getPhotos(aid) { 
    sql = 'SELECT pid, src_big, src_small FROM photo WHERE aid='+aid+' ORDER BY modified desc'; 
    FB.api(
     { 
     method: 'fql.query', 
     query: sql 
    }, 
     function(response) { 
      console.log(response); 
     } 
    ); 
} 

回答

2

雖然發佈的錯誤會有所幫助,你應該用引號括的aid因爲它是一個字符串字段(ref):

sql = 'SELECT pid, src_big, src_small FROM photo WHERE aid="'+aid+'" ORDER BY modified desc'; 

另外,還要確保你有正確的權限user_photos

相關問題