How does PHP obtain the output parameters of the mssql stored procedure ?. Use the built-in function 1 in phpmssql. initialize the stored procedure $ stmtmssql_init (procedurename); 2. bind variable input parameters: mssql_bind ($ stmt, @ operate_flag, $ status, SQLVARCH use built-in functions in php mssql
1. initialize the stored procedure
$ Stmt = mssql_init ('procedure name ');
2. bind variables
Input parameters:
Mssql_bind ($ stmt, '@ operate_flag', $ status, SQLVARCHAR); note that the third parameter must be a variable; otherwise, an error is returned.
Output parameters:
Mssql_bind ($ stmt, '@ return_mess', $ output, SQLVARCHAR, true); the fifth parameter indicates whether the output tag is used.
Execute the stored procedure
$ Retult = mssql_execute ($ stmt); the second parameter is whether to return the result set. The change setting is irrelevant to the return value.
Disconnect
Mssql_free_statement ($ stmt );
Output value in variable $ output
When a stored procedure has multiple returned result sets and return values, the processing method is different:
Explanation from PHP maintainers:
Originally, this call method was certainly supported by PHP 4.3.
"However, since PHP version 4.3," they said, "to be compatible with stored procedures and return multiple result sets, PHP has changed this feature ."
"If you do not need a result set, you should set the Second Optional parameter of mssql_execute to TRUE, so that you can get the output parameter after the mssql_execute method ."
"If you want to return the result set, you should call mssql_next_result once for each result set. After the last result set is returned, you can call mssql_next_result to obtain the returned value FALSE. in this case, you can access the output parameters.
Modify the code as follows:
Mssql_next_result ($ result );
Built-in functions in mssql 1. initialize the stored procedure $ stmt = mssql_init (procedure name); 2. bind variable input parameters: mssql_bind ($ stmt, @ operate_flag, $ status, SQLVARCH...