note 41320 deleted from function.mssql-execute by nlopess

From: Date: Fri, 09 Apr 2004 19:17:23 +0000
Subject: note 41320 deleted from function.mssql-execute by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-67912@lists.php.net to get a copy of this message
Note Submitter: vladimir y. plotnikov ---- PHP 4.3.5/Win32, MSSQL 2000; 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. <? $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 This is a bug? How I can get RETVAL from SP? Thank you. Vladimir

« previous php.notes (#67912) next »