#27615 [Opn->Bgs]: mssql_bind not working with stored proc return value
| From: | fmk@php.net | Date: | Wed, 17 Mar 2004 19:03:54 +0000 |
| Subject: | #27615 [Opn->Bgs]: mssql_bind not working with stored proc return value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56597@lists.php.net to get a copy of this message | ||
ID: 27615
Updated by: fmk@php.net
Reported By: webmaster at groupphotographers dot com
-Status: Open
+Status: Bogus
Bug Type: MSSQL related
Operating System: Windows Server 2003
PHP Version: 4.3.4
New Comment:
The code was changed for php 4.3 to handle the return of multiple
results from a stored procedure. If you don't need the results you
should use the optional parameter on mssql_execute to skip the results
and the return value will be available after the call to mssql_execute.
If you need the results you should call mssql_next_result for each
result returned. After the last result has been returned the return
value will have the value returned by the stored procedure.
http://http://php.net/mssql_execute
Previous Comments:
------------------------------------------------------------------------
[2004-03-16 18:43:13] webmaster at groupphotographers dot com
Description:
------------
mssql_bind function does not seem to be working when trying to bind
return value (RETVAL) from stored procedure.
Reproduce code:
---------------
// OPEN CONNECTION, ETC...
$customer_id = <INTEGER GOES HERE>;
$subject_id = <INTEGER GOES HERE>;
mssql_bind($query, "RETVAL", &$retval, SQLINT1);
mssql_bind($query, "@iCustomerID", &$customer_id, SQLINT4);
mssql_bind($query, "@iSubjectID", &$subject_id, SQLINT4);
$result = mssql_execute($query);
mssql_close($dbc);
Expected result:
----------------
I expect to have $retval equall something else than '0' in many
cases--but it always equalls '0'. The same code gives the expected
results in PHP 4.2.1 on MS Windows Server.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27615&edit=1