可能重复:
在此代码中的类型会话(使用Facebook 3.0.1)有一些问题:
$page_id = 192485754113829;
$post_limit = 2;
$result = $facebook->api(array(
'method' => 'fql.multiquery',
'queries' => '{
"stream": "select post_id, source_id, actor_id, target_id, created_time, likes, message, attachment, comments from stream where source_id = '.$page_id.' LIMIT '.$post_limit.'"}'
));分析器错误:意外'.‘在130号阵地。
我无法解释,这段代码在不同主机上的工作方式不同。php.ini中是否存在某些类型设置?
发布于 2011-07-30 09:11:41
您的代码片段编译得很好。此错误发生在代码的其他部分。也可能是与操作系统32位或64位连接。
192485754113829号对于32位php来说太大了
发布于 2011-07-30 10:25:02
对于php的32位整数类型,您的$page_id太大了,因此它被解释为64位浮点数,并且打印为$page_id MySql并不期望一个浮点数作为限值,因此它给出了意外的'.'错误。将查询更改如下:
'select post_id, source_id, actor_id, target_id, created_time, likes,
message, attachment, comments from stream
where source_id = '.sprintf( '%u', $page_id ).' LIMIT '.$post_limit它应该能正常工作。
https://stackoverflow.com/questions/6882163
复制相似问题