#22294 [Opn]: Output parameter is not populated

From: Date: Tue, 22 Apr 2003 11:45:22 +0000
Subject: #22294 [Opn]: Output parameter is not populated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38061@lists.php.net to get a copy of this message
ID: 22294 User updated by: rajesh dot gala at cgi dot com Reported By: rajesh dot gala at cgi dot com Status: Open Bug Type: MSSQL related Operating System: win32 PHP Version: 4.3.2-dev New Comment: mssql_bind($stmt,"@ReturnVal",&$ReturnVal,SQLINT4,True); does not work. Previous Comments: ------------------------------------------------------------------------ [2003-04-10 04:43:50] arnarb at oddi dot is The documentation states that output variables have to be passed by reference into mssql_bind. Like this mssql_bind($stmt,"@ReturnVal",&$ReturnVal,SQLINT4,True); Also, the documentation also notes that if a stored procedure returns multiple result sets, the output parameters will _not_ be available until mssql_next_result has been called for the last result-set. Does this have any effect on your test cases? --Arnar ------------------------------------------------------------------------ [2003-03-06 23:20:49] sniper@php.net forget my last comment, I didn't notice that you already had tried the snapshot.. ------------------------------------------------------------------------ [2003-03-06 23:19:45] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip There have been some fixes for mssql stuff in it.. ------------------------------------------------------------------------ [2003-03-06 23:12:25] rajesh dot gala at cgi dot com The version of PHP is use is 4.3.1 windows binary downloaded from the php.net site. The zip file date is 18-Feb-2003. SQL Server 2000 OS Win 2000 Webserver Apache 4.0.44 ------------------------------------------------------------------------ [2003-03-06 23:08:14] rajesh dot gala at cgi dot com This too does not Work PHPCode $UserID = 'ADMIN'; $conn = mssql_connect("SERVER", "UID", "PASS"); mssql_select_db("DBANAME",$conn); $stmt = mssql_init("SELUser",$conn); mssql_bind($stmt,"@UserID",$UserID,SQLCHAR,false); mssql_bind($stmt,"@ReturnVal",$ReturnVal,SQLINT4,True); $result=mssql_execute($stmt); mssql_fetch_array($result); echo $ReturnVal; Stored Procedure CREATE PROCEDURE [SELUser] @UserID CHAR(10), @ReturnVal INT OUTPUT AS BEGIN SELECT * FROM [User] USR WHERE USR.[User ID] = @UserID SET @ReturnVal=@@ROWCOUNT END I get the data in the resultset but not in the Output paramenter. I have used the Output parameter in different ways across the application. How can we get the output parameter populated. Thanks ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22294 -- Edit this bug report at http://bugs.php.net/?id=22294&edit=1

« previous php.bugs (#38061) next »