|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-14 10:12 UTC] jeffmlevy+phpbugs at gmail dot com
Description:
------------
Note: Mysql PDO.
PDO fails with error when calling fetchAll() w/PDO::FETCH_INTO.
Implicit call to setFetchMode(PDO::FETCH_INTO, $oObject) passes the test, however.
Reproduce code:
---------------
$stmt = $dbh->prepare("call data_loader()");
$stmt->setFetchMode(PDO::FETCH_INTO, $this);
$stmt->fetchAll();
results in proper assignment of return vars to object props.
BUT:
$stmt = $dbh->prepare("call data_loader()");
$stmt->fetchAll(PDO::FETCH_INTO, $this);
calling with $this results in:
PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: Extraneous additional parameters
calling without $this results in
PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch-into object specified.
Expected result:
----------------
Expect class properties to be properly populated.
Actual result:
--------------
Error thrown.
Could be lack of documenatation??
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
sovled: $stmt = $this->dbh->query("call load($data_id)",, PDO::FETCH_INTO, $this); $stmt->fetch(); wez, can I have your baby? rule.