note 41320 added to function.mssql-execute
| From: | vladimiry dot plotnikov at rn2 dot php dot net | Date: | Tue, 06 Apr 2004 13:53:04 +0000 |
| Subject: | note 41320 added to function.mssql-execute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67708@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.mssql-execute.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41320
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41320&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41320&report=yes
Search -- http://master.php.net/manage/user-notes.php