note 101080 added to pdostatement.fetchobject
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 24 Nov 2010 22:57:59 +0000 |
| Subject: | note 101080 added to pdostatement.fetchobject | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174337@lists.php.net to get a copy of this message | ||
By default the constructor of the class is called after the fields are populated.
PDO::FETCH_PROPS_LATE used to change the behaviour and make it work as expected - the object fields
will be populated with the data _after_ the constructor call.
$PDO->query($sql,PDO::FETCH_PROPS_LATE )->fetchObject('ClassName');
----
Server IP: 69.147.83.197
Probable Submitter: 178.94.9.50
----
Manual Page -- http://www.php.net/manual/en/pdostatement.fetchobject.php
Edit -- https://master.php.net/note/edit/101080
Del: integrated -- https://master.php.net/note/delete/101080/integrated
Del: useless -- https://master.php.net/note/delete/101080/useless
Del: bad code -- https://master.php.net/note/delete/101080/bad+code
Del: spam -- https://master.php.net/note/delete/101080/spam
Del: non-english -- https://master.php.net/note/delete/101080/non-english
Del: in docs -- https://master.php.net/note/delete/101080/in+docs
Del: other reasons-- https://master.php.net/note/delete/101080
Reject -- https://master.php.net/note/reject/101080
Search -- https://master.php.net/manage/user-notes.php