本篇文章是对php调用MsSQL存储过程使用内置RETVAL获取过程中的return值的方法进行了详细的分析介绍,需要的朋友参考下
【PHP代码】
复制代码 代码如下:
$stmt = mssql_init('P__Global_Test', $conn) or die("initialize stored procedure failure");
mssql_bind($stmt, "RETVAL", $returnValue, SQLINT4, true);
mssql_execute($stmt, false);
if( $returnValue == 0 ){
echo 'ABCD';
}
else{
echo 'EFGH';
}
【存储过程】
复制代码 代码如下:
CREATE PROCEDURE dbo.P__User_JudgeResume(
)
set nocount on
set @Message = ''
if not exists( select * from _Test )
begin
return 0
end
else
begin
return 1
end
set nocount off
GO
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn