From: Operating system: Linux PHP version: 5.3.10 Package: PDO related Bug Type: Bug Bug description:Fetch Class does not set the column name
Description:
------------
PDOStatement::Fetch using PDO::FETCH_CLASS does not set the attribute name.
The class set function is called with an empty var name but correct
variable value.
Test script:
---------------
$connection = new PDO($dsn, $user, $password);
$sql = 'select 1 as columnname from table where 1 = :value';
$stmt = $connection->prepare($sql);
$stmt->bindValue(':value', 1);
$result = $stmt->execute();
$class = $stmt->fetchAll(PDO::FETCH_CLASS, 'Test');
Expected result:
----------------
Will get an array of class Test with property '' and value 1.
Actual result:
--------------
Expect to see column name as 'columnname'
--
Edit bug report at https://bugs.php.net/bug.php?id=61101&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61101&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61101&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61101&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61101&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61101&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61101&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61101&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61101&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61101&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61101&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61101&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61101&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61101&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61101&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61101&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61101&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61101&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61101&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61101&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61101&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61101&r=mysqlcfg
