ID:               35671
 Comment by:       dkrook at hotmail dot com
 Reported By:      mknobloch at midstate dot edu
 Status:           Assigned
 Bug Type:         PDO related
 Operating System: Windows 2003 SP1
 PHP Version:      5.1.2
 Assigned To:      wez
 New Comment:

I've encountered the same problem with DB2 and '?' parameter markers.

http://marc.theaimsgroup.com/?l=php-db&m=114014376609292&w=2


Previous Comments:
------------------------------------------------------------------------

[2006-02-16 00:20:43] stoens at activegrid dot com

I am seeing the same thing with the OCI and the ODBC drivers on Windows
and Linux (FC4). Same PHP version.

------------------------------------------------------------------------

[2006-01-12 17:32:07] mknobloch at midstate dot edu

This bug still exists in 5.1.2.

It can be worked around by replacing php_pdo.dll and php_pdo_odbc.dll
with their counterparts from 5.1.0, but it would be nice to have it
fixed.

------------------------------------------------------------------------

[2005-12-16 11:43:03] [EMAIL PROTECTED]

assigned to the maintainer.

------------------------------------------------------------------------

[2005-12-15 14:33:41] mknobloch at midstate dot edu

The problem still exists in the 200512151130 Win32 snapshot.

------------------------------------------------------------------------

[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

Reply via email to