#45075 [NEW]: mssql_bind $var must be passed by reference, not by value
| From: | geoff at ivent dot com dot au | Date: | Fri, 23 May 2008 05:44:56 +0000 |
| Subject: | #45075 [NEW]: mssql_bind $var must be passed by reference, not by value | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-844@lists.php.net to get a copy of this message | ||
From: geoff at ivent dot com dot au
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: mssql_bind $var must be passed by reference, not by value
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 bug report at http://bugs.php.net/?id=45075&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45075&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45075&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45075&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45075&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45075&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45075&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45075&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45075&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45075&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45075&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45075&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45075&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45075&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45075&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45075&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45075&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45075&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45075&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45075&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45075&r=mysqlcfg