|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21089 mssql_bind not returning output parameters from stored procedure call
Submitted: 2002-12-18 20:03 UTC Modified: 2003-01-16 17:57 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lornie at magix dot com dot sg Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.3.0RC3 & 4.3.0RC4 & PHP Version 4.3.1-dev OS: Windows 2000 Server SP3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lornie at magix dot com dot sg
New email:
PHP Version: OS:


 [2002-12-18 20:03 UTC] lornie at magix dot com dot sg
Making use of mssql_bind to retrieve output parameters from a stored procedure in MSSQL7 always return 0 when PHP operates in ISAPI or CGI mode under IIS5.

It was noted that although it didn't return the parameter, however it is able to accept input parameters. It is also returning the query result. Just not the output parameter.

It work fine in PHP4.23 when it is run on CGI mode. Did not test if ISAPI works though.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-22 20:53 UTC] lornie at magix dot com dot sg
4.3.0RC4 produce the same result
 [2003-01-09 12:09 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

This problem was caused by mssql_execute being able to retreive multiple results from a single stored procedure.
 [2003-01-15 00:09 UTC] lornie at magix dot com dot sg
I am still facing the same problem after applying PHP Version 4.3.1-dev (Built On: Jan 15, 2003 01:30 GMT).

Just in case this will be helpful, the stored procedure that I am using only return 1 resource link and 1 output parameter.
 [2003-01-16 17:57 UTC]
with php 4.3.1-dev you have two options to get output and return values from a stored procedure also returning results.

1) call mssql_execute with an optional skip parameter
mssql_execute($stmt, true);

2) call mssql_next_result() for each result set returned by the SP. This way you can handle multiple results. When mssql_next_result() returns false you will have access to output parameters and return value.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 07:01:25 2023 UTC