ID: 43139
Comment by: stochnagara at hotmail dot com
Reported By: develar at gmail dot com
Status: Open
Bug Type: PDO related
Operating System: Windows XP SP2
PHP Version: 5.2.4
New Comment:
I have a similar problem with 5.2.4 on a linux/mysql installation. The
things worked on 5.2.0. The only difference is that I have a class that
overrides PDOStatement and there I use $this->setFetchMode
(PDO::FETCH_OBJ) which is not taken into account if FETCH_OBJ is not
explicitly set in further fetch/fetchAll calls.
Previous Comments:
------------------------------------------------------------------------
[2007-10-30 11:49:32] develar at gmail dot com
Description:
------------
In 5.2.4 (earlier all worked) and 5.2.5RC2dev (I now use this version)
PDO ignore ATTR_DEFAULT_FETCH_MODE.
PostgreSQL 8.2.4 and 8.3beta1.
Reproduce code:
---------------
<?php
$Db = new PDO('pgsql:host=localhost;dbname=test', 'postgres',
'password');
$Db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$Db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
print_r($Db->query('select 0 as name, 1 as table, 2 as
schema')->fetchAll(PDO::FETCH_GROUP));
?>
Expected result:
----------------
Array
(
[0] => Array
(
[0] => Array
(
[table] => 1
[schema] => 2
)
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[0] => Array
(
[table] => 1
[0] => 1
[schema] => 2
[1] => 2
)
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43139&edit=1