Home > php教程 > php手册 > body text

php调用MsSQL存储过程使用内置RETVAL获取过程中的return值

WBOY
Release: 2016-06-13 11:32:25
Original
1023 people have browsed it

本篇文章是对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';
Copy after login


【存储过程】

复制代码 代码如下:


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

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template