Php calls the MsSQL stored procedure and uses the built-in RETVAL to obtain the return value in the stored procedure. This article provides a detailed analysis of the php method for calling the MsSQL stored procedure and using the built-in RETVAL to obtain the return value, for more information, see [PHP code]. This article describes how to use the built-in RETVAL to obtain the return value in the MsSQL stored procedure, for more information, see
PHP code]
The code is as follows:
$ 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';
}
Stored Procedure]
The code is as follows:
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
PHP code ]...