开发者

Error in FQLQuery

I have an FQL query:

$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in (implode(",", $man);)';
开发者_运维知识库

$man is an array.

This query is not working, and I am getting an error from Facebook saying "unexpected $ in line 45"

What's wrong with this query?

I tried it with join() also giving me the same error. How can I fix this problem?


Assuming $man is a single dimensional array of Facebook User IDs, it should be:

$FQLQuery = 'SELECT uid, sex, pic_square FROM user WHERE uid in ('.implode(",", $man).')';


I think I got the error, just change that line in your code like

$FQLQuery = "SELECT uid, sex, pic_square FROM user WHERE uid in (implode(',', {$man}))"; 

and it will fix the error. As your $FQLQuery was surrounded by single quote, so $man was not being parsed a variable :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜