|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36428 Incorrect error message for PDO::fetchAll
Submitted: 2006-02-17 16:35 UTC Modified: 2006-02-24 17:05 UTC
From: stochnagara at hotmail dot com Assigned: helly (profile)
Status: Closed Package: SimpleXML related
PHP Version: 5.1.* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: stochnagara at hotmail dot com
New email:
PHP Version: OS:


 [2006-02-17 16:35 UTC] stochnagara at hotmail dot com
Trying to fetch DB result into a SimpleXMLElement instance produces an incorrect error message.

Reproduce code:
$q = new PDO('sqlite::memory:');
$q->exec ("CREATE TABLE test (a)");
$q->exec ("INSERT INTO test (a) VALUES (1)");
var_dump ($q->query ("SELECT a FROM test")->fetchAll(PDO::FETCH_CLASS, 'SimpleXMLElement', array ('<root/>')));

Expected result:
Some consistent error message.

Actual result:

Warning:  PDOStatement::fetchAll() [function.fetchAll]: Node no longer exists in c:\program files\apache group\Apache\htdocs\standart\index.php on line 6

array(1) {
  object(SimpleXMLElement)#3 (0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-22 08:52 UTC]
This error message comes from SimpleXML.
 [2006-02-24 16:58 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Use CVS and add new flag PDO:FETCH_PROPSLATE.

SimpleXMLElement does not allow to write properties prior to calling the ctor.

In 5.1 you would need to change to use FETCH_FUNC instead.
 [2006-02-24 17:05 UTC]
Make this PDO:FETCH_PROPS_LATE. The other developers didn't like the name without the '_'.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 22:01:30 2024 UTC