php_pdo在使用mysql存储过程结果出错
我的存储过程
create procedure newComm(in t int, in topicLis varchar(250))
begin
set @a = CONCAT('select tid,topicid,content,uid,date from comments where topicid in (', topicLis , ') and date >=', t);
prepare stmt1 from @a;
execute stmt1;
deallocate prepare stmt1;
end;
表
CREATE TABLE `comments` (
`tid` bigint(20) NOT NULL auto_increment,
`topicid` bigint(20) NOT NULL,
`uid` bigint(20) NOT NULL,
`date` int(11) default NULL,
`content` varchar(288) default NULL,
PRIMARY KEY (`tid`)
)
情况:
1.在windows下,无论是在mysql黑窗口,还是在php里面执行,结果均正常;
2.在linux下,在mysql黑窗口里面执行, 结果正常;
3.在linux下,在php里面执行,结果出错。详情情况如下(预期:这两个结果应该一样)
在php里面直接使用mysql语句查询的(select tid,topicid,content,uid,date from comments where topicid in (', topicLis , ') and date >=', t)
Array(
[0] => Array
(
[tid] => 304
[topicid] => 1249
[content] => 漂亮哦
[uid] => 137
[date] => 1308382195
[name] => daxi
[sex] => 0
[headImg] => 0
[imgtype] => jpg
)
)
在php里面,调用存储过程得到的结果
Array
(
[0] => Array
(
[tid] => -4389820840436235212
[topicid] => -6574241152680279386
[content] =>
[uid] =>
[date] => -1362969918
[name] => �“¦137
1308382195daxi00jpg�jpg�e from comments left join user on uid=id where topicid in (1249) and date >=0;�'
�
�
[sex] => 119
[headImg] => 49
[imgtype] =>
���
)
)
求指点分析,或是告知分析方向