|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespdostatement_fetch_class_fix (last revision 2012-02-16 04:43 UTC by anilvarghese25 at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-14 20:11 UTC] iliaa@php.net
-Status: Open
+Status: Feedback
[2012-03-14 20:11 UTC] iliaa@php.net
[2012-03-14 20:14 UTC] anilvarghese25 at gmail dot com
[2012-03-14 20:17 UTC] anilvarghese25 at gmail dot com
[2013-01-04 21:48 UTC] anilvarghese25 at gmail dot com
[2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
[2013-10-17 16:00 UTC] anilvarghese25 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 03:00:01 2025 UTC |
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'