我有一个FQL查询:
$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in (implode(",", $man);)';
$ man是一个数组。
此查询无法正常工作,我从Facebook收到错误“第45行意外$”
此查询有什么问题?
我用join()
试了一次也给了我同样的错误。我该如何解决这个问题?
答案 0 :(得分:3)
假设$man
是Facebook用户ID的单维数组,则应为:
$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in ('.implode(",", $man).')';
答案 1 :(得分:0)
我认为我收到了错误,只需在代码中更改该行,如
$FQLQuery = "SELECT uid, sex, pic_square FROM user WHERE uid in (implode(',', {$man}))";
它将修复错误。由于你的$ FQLQuery被单引号包围,所以$ man没有被解析为变量:)