#45075 [Opn->Csd]: mssql_bind $var must be passed by reference, not by value
| From: | vrana@php.net | Date: | Wed, 05 Nov 2008 16:47:45 +0000 |
| Subject: | #45075 [Opn->Csd]: mssql_bind $var must be passed by reference, not by value | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1379@lists.php.net to get a copy of this message | ||
ID: 45075
Updated by: vrana@php.net
Reported By: geoff at ivent dot com dot au
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2008-11-05 16:47:26] vrana@php.net
"It is passed by reference, to retrieve OUTPUT and RETVAL values after
the procedure execution. "
------------------------------------------------------------------------
[2008-05-23 05:44:56] geoff at ivent dot com dot au
Description:
------------
The mssql_bind function documentation states:
===
$var - The PHP variable you'll bind the MSSQL parameter to. You can
pass it by value, or by reference, to retrieve OUTPUT and RETVAL values
after the procedure execution.
===
If the value is bound by value, it a random chunk of memory to be bound
as the value.
I am using the latest TDS stable, using TDS version 8.0 talking to a
Microsoft SQL 2000 Server.
Reproduce code:
---------------
$value = 'Test';
$proc = mssql_init('myProc');
mssql_bind($proc, '@myVal', $value, SQLVARCHAR, false, false, 50);
var_dump(mssql_execute($proc));
Expected result:
----------------
The database should receive the following command:
exec myProc @myVal = 'Test'
Actual result:
--------------
The database server receives the following command:
exec myProc @myVal = ';Àe
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45075&edit=1