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 :)
精彩评论