php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27615 mssql_bind not working with stored proc return value
Submitted: 2004-03-16 18:43 UTC Modified: 2004-03-17 14:03 UTC
From: webmaster at groupphotographers dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.4 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2004-03-16 18:43 UTC] 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. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-17 14:03 UTC] fmk@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 14:01:30 2024 UTC