#35671 [Opn->Asn]: Named parameters not working in PDO_ODBC
| From: | tony2001@php.net | Date: | Fri, 16 Dec 2005 10:43:04 +0000 |
| Subject: | #35671 [Opn->Asn]: Named parameters not working in PDO_ODBC | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90535@lists.php.net to get a copy of this message | ||
ID: 35671
Updated by: tony2001@php.net
Reported By: mknobloch at midstate dot edu
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: Windows 2003 SP1
PHP Version: 5.1.1
-Assigned To:
+Assigned To: wez
New Comment:
assigned to the maintainer.
Previous Comments:
------------------------------------------------------------------------
[2005-12-15 14:33:41] mknobloch at midstate dot edu
The problem still exists in the 200512151130 Win32 snapshot.
------------------------------------------------------------------------
[2005-12-15 10:18:54] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2005-12-14 21:04:50] mknobloch at midstate dot edu
Description:
------------
When using a named parameters array, PDO_ODBC substitutes the last
value in the array for each named parameter.
This code works fine in 5.1.0. The bug first appeared in 5.1.1. I can
also confirm that this bug does not affect PDO_SQLITE.
Reproduce code:
---------------
$dbh = new PDO("odbc:testdb");
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$sql = "INSERT INTO testtable (field1, field2, field3) VALUES (:value1,
:value2, :value3)";
$sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR,
PDO::CURSOR_FWDONLY));
$parm = array(
":value1" => 15,
":value2" => 20,
":value3" => 25
);
$sth->execute($parm);
Expected result:
----------------
I expect a new record to be inserted into the table with field1 = 15,
field2 = 20, and field3 = 25
Actual result:
--------------
A new record is created, but 25 is inserted into all three fields.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35671&edit=1