Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35671 : Named parameters not working in PDO_ODBC
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 1st May 20:04
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC



From: mknobloch at midstate dot edu
Operating system: Windows 2003 SP1
PHP version: 5.1.1
PHP Bug Type: PDO related
Bug description: Named parameters not working in PDO_ODBC

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 bug report at http://bugs.php.net/?id=35671&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35671&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35671&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35671&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35671&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35671&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35671&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35671&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35671&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35671&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35671&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35671&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35671&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35671&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35671&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35671&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35671&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35671&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35671&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35671&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35671&r=mysqlcfg
  Reply With Quote


  sponsored links


2 1st May 23:32
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC



ID: 35671
Updated by: sniper@php.net
Reported By: mknobloch at midstate dot edu
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Windows 2003 SP1
PHP Version: 5.1.1
New Comment:

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


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

[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 With Quote
3 1st May 23:33
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
User updated by: mknobloch at midstate dot edu
Reported By: mknobloch at midstate dot edu
-Status: Feedback
+Status: Open
Bug Type: PDO related
Operating System: Windows 2003 SP1
PHP Version: 5.1.1
New Comment:

The problem still exists in the 200512151130 Win32 snapshot.


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

[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
  Reply With Quote
4 2nd May 06:02
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


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
  Reply With Quote
5 6th May 19:13
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
User updated by: mknobloch at midstate dot edu
Reported By: mknobloch at midstate dot edu
Status: Assigned
Bug Type: PDO related
Operating System: Windows 2003 SP1
-PHP Version: 5CVS-2005-12-15 (snap)
+PHP Version: 5.1.2
Assigned To: wez
New Comment:

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.


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

[2005-12-16 11:43:03] tony2001@php.net

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 With Quote
6 20th May 09:07
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
Comment by: stoens at activegrid 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 am seeing the same thing with the OCI and the ODBC drivers on Windows
and Linux (FC4). Same PHP version.


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

[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] tony2001@php.net

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 With Quote
7 20th May 16:05
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


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] tony2001@php.net

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 With Quote
8 22nd May 13:40
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
Comment by: bubblenut at gmail 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'm getting this problem with all parameters (named and otherwise) with
PDO_MYSQL 1.0.1 with both php-5.1.2 and php-5.1.3-dev on Linux (Kubuntu
Breezy)


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

[2006-02-17 19:02:14] dkrook at hotmail dot com

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

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

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

[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] tony2001@php.net

assigned to the maintainer.

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

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

The problem still exists in the 200512151130 Win32 snapshot.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35671

--
Edit this bug report at http://bugs.php.net/?id=35671&edit=1
  Reply With Quote
9 23rd May 16:57
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
Comment by: alien at mosfasad dot ru
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:

bug exists in snapshot of 09 Mar 2006 04:32:09 +0100


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

[2006-03-02 18:32:00] bubblenut at gmail dot com

I'm getting this problem with all parameters (named and otherwise) with
PDO_MYSQL 1.0.1 with both php-5.1.2 and php-5.1.3-dev on Linux (Kubuntu
Breezy)

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

[2006-02-17 19:02:14] dkrook at hotmail dot com

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

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

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

[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] tony2001@php.net

assigned to the maintainer.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35671

--
Edit this bug report at http://bugs.php.net/?id=35671&edit=1
  Reply With Quote
10 23rd May 16:57
php-bugs
External User
 
Posts: 1
Default #35671 : Named parameters not working in PDO_ODBC


ID: 35671
Comment by: alien at mosfasad dot ru
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:

No bug in sqlite2 and sqlite Driver.
$oPdo = new PDO('sqlite:test.lite');
$oStat = $oPdo->prepare("INSERT INTO php_qqq (name, value) VALUES (?,
?)");
$oStat->execute(array('1','444'));
____
in table php_qqq have values (1 and 444);


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

[2006-03-09 09:54:45] alien at mosfasad dot ru

bug exists in snapshot of 09 Mar 2006 04:32:09 +0100

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

[2006-03-02 18:32:00] bubblenut at gmail dot com

I'm getting this problem with all parameters (named and otherwise) with
PDO_MYSQL 1.0.1 with both php-5.1.2 and php-5.1.3-dev on Linux (Kubuntu
Breezy)

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

[2006-02-17 19:02:14] dkrook at hotmail dot com

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

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

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

[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.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35671

--
Edit this bug report at http://bugs.php.net/?id=35671&edit=1
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666