#36428 [Csd]: Incorrect error message for PDO::fetchAll
| From: | helly@php.net | Date: | Fri, 24 Feb 2006 16:05:24 +0000 |
| Subject: | #36428 [Csd]: Incorrect error message for PDO::fetchAll | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93633@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: Closed
Bug Type: SimpleXML related
Operating System: *
PHP Version: 5.1.*
Assigned To: helly
New Comment:
Make this PDO:FETCH_PROPS_LATE. The other developers didn't like the
name without the '_'.
Previous Comments:
------------------------------------------------------------------------
[2006-02-24 16:58:11] helly@php.net
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.
------------------------------------------------------------------------
[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