#36428 [Opn->Csd]: Incorrect error message for PDO::fetchAll

From: Date: Fri, 24 Feb 2006 15:58:12 +0000
Subject: #36428 [Opn->Csd]: Incorrect error message for PDO::fetchAll
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93632@lists.php.net to get a copy of this message
ID: 36428 Updated by: helly@php.net Reported By: stochnagara at hotmail dot com -Status: Open +Status: Closed Bug Type: SimpleXML related -Operating System: win xp +Operating System: * -PHP Version: 5CVS-2006-02-17 (snap) +PHP Version: 5.1.* -Assigned To: +Assigned To: helly New Comment: 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 http://snaps.php.net/. 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. Previous Comments: ------------------------------------------------------------------------ [2006-02-22 08:52:10] tony2001@php.net This error message comes from SimpleXML. Reclassified. ------------------------------------------------------------------------ [2006-02-17 16:35:27] stochnagara at hotmail dot com Description: ------------ 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) { [0]=> object(SimpleXMLElement)#3 (0) { } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36428&edit=1

« previous php.bugs (#93632) next »