#22294 [Com]: Output parameter is not populated

From: Date: Thu, 06 Mar 2003 10:44:01 +0000
Subject: #22294 [Com]: Output parameter is not populated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-34955@lists.php.net to get a copy of this message
ID: 22294 Comment by: php at centaur dot mailshell dot com Reported By: rajesh dot gala at cgi dot com Status: Open Bug Type: MSSQL related Operating System: win32 PHP Version: 4.3.1 New Comment: In addition to my previous comment: Windows XP SP1 MSSQL 2000 PHP Version => 4.3.2-dev Build Date => Feb 26 2003 02:23:31 Server API => Apache 2.0 Filter Previous Comments: ------------------------------------------------------------------------ [2003-03-06 04:39:30] php at centaur dot mailshel dot com Output parameters seem to be populated after all result set are fetched using mssql_next_result(). However, mssql_execute seems to only return a valid result set resource on 'SELECT' queries, and not 'SELECT @param = expr' queries. The $result in a similar case is just 1. ------------------------------------------------------------------------ [2003-02-19 04:36:40] rajesh dot gala at cgi dot com I use MS SQL 2000. I have a simple Stored procedure to be executed. the code is as below the Stored proc is Create PROCEDURE [AuthLoginUser] @LoginUser CHAR(10), @Password CHAR(32), @ReturnVal INT OUTPUT AS BEGIN SELECT @ReturnVal = count(*) FROM [User] USR WHERE USR.[User ID] = @LoginUser AND USR.[Password] = @Password AND USR.[Status]='A' END The php code is as below $stmt = mssql_init("AuthLoginUser", $conn); $LoginUser=$strRegisteredUsername ; $Password=$strRegisteredPassword ; mssql_bind($stmt,"@LoginUser",$LoginUser,SQLVARCHAR); mssql_bind($stmt,"@Password",$Password,SQLVARCHAR); mssql_bind($stmt,"@ReturnVal",$ReturnVal,SQLINT4,True); $result=mssql_execute($stmt); echo '<br><b>Return Value'.$ReturnVal.'</b>'; The problem is that variable $ReturnVal does not get populated I executed the Stored procedure in the query analyser and I get values for the same. Thanks, Rajesh ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22294&edit=1

« previous php.bugs (#34955) next »