#27880 [Opn]: Problem with RETVAL after execute

From: Date: Tue, 06 Apr 2004 09:15:15 +0000
Subject: #27880 [Opn]: Problem with RETVAL after execute
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-57576@lists.php.net to get a copy of this message
ID: 27880 User updated by: v at sas dot nsk dot su Reported By: v at sas dot nsk dot su Status: Open Bug Type: MSSQL related Operating System: WinXP Professional MSSQL 2k PHP Version: 4.3.5 New Comment: I inspect function in ext/mssql/php_mssql.c void _mssql_get_sp_result(...) in line: num_rets = dbnumrets(mssql_ptr->link); num_rets stay as zero. may be I made some wrong? Please help! Previous Comments: ------------------------------------------------------------------------ [2004-04-06 03:13:11] v at sas dot nsk dot su Description: ------------ Hello! Please take a look for next script: create procedure test @inp1 int as begin if @inp1 >10 return 10 return @inp1; end go This SP just returing values. nothing more. I cannot return record sets - I use this SP from PHP and from another SP. This is a bug? How I can get RETVAL from SP? Thank you. Vladimir Reproduce code: --------------- <? $db=mssql_connect('localhost', '****', '***'); mssql_select_db('mpo'); $stmt = mssql_init ('test'); $ret=0; $inp1=7; mssql_bind($stmt,'RETVAL',&$ret, SQLINT4); mssql_bind($stmt,'@inp1',$inp1, SQLINT4); $res=mssql_execute($stmt); echo "@inp1=".$inp1."\n"; echo "RETVAL=".$ret."\n"; echo "Res is:\n"; print_r($res); echo "\nnext test:\n"; $inp1=64; $stmt = mssql_init ('test'); mssql_bind($stmt,'RETVAL',&$ret, SQLINT4); mssql_bind($stmt,'@inp1',$inp1, SQLINT4); $res=mssql_execute($stmt); echo "@inp1=".$inp1."\n"; echo "RETVAL=".$ret."\n"; echo "Res is:\n"; print_r($res); echo "\ndone\n"; ? Expected result: ---------------- @inp1=7 RETVAL=7 Res is: 1 next test: @inp1=64 RETVAL=10 Res is: 1 done Actual result: -------------- @inp1=7 RETVAL=0 Res is: 1 next test: @inp1=64 RETVAL=0 Res is: 1 done ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27880&edit=1

« previous php.bugs (#57576) next »