TP5执行存储过程报The active result for the query contains no fields.
Posted 亦星
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TP5执行存储过程报The active result for the query contains no fields.相关的知识,希望对你有一定的参考价值。
创建SqlServer存储过程
create procedure INSERT_USERINFO
@NAME varchar(16)
AS
BEGIN
--指定插入标识符的显式值
set IDENTITY_INSERT USERINFO ON
insert into USERINFO(USERID,NAME,BADGENUMBER) select USERID,NAME,BADGENUMBER from USERINFO_BEI where [email protected]
set IDENTITY_INSERT USERINFO OFF
END
php执行上面存储过程报错
$pro = "exec INSERT_USERINFO " . $value[‘realname‘]; $codeu = $db->query($pro);
修改存储过程
create procedure INSERT_USERINFO
@NAME varchar(16)
AS
BEGIN
set nocount on
set IDENTITY_INSERT USERINFO ON
insert into USERINFO(USERID,NAME,BADGENUMBER) select USERID,NAME,BADGENUMBER from USERINFO_BEI where [email protected]
set IDENTITY_INSERT USERINFO OFF
SELECT 1
END
$pro = "exec INSERT_USERINFO " . $value[‘realname‘]; $codeu = $db->query($pro); //返回1
OK
以上是关于TP5执行存储过程报The active result for the query contains no fields.的主要内容,如果未能解决你的问题,请参考以下文章