#38252 [Opn]: Incorrect PDO error message

From: Date: Sat, 29 Jul 2006 18:23:30 +0000
Subject: #38252 [Opn]: Incorrect PDO error message
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100064@lists.php.net to get a copy of this message
ID: 38252 Updated by: pajoye@php.net Reported By: stochnagara at hotmail dot com Status: Open Bug Type: PDO related Operating System: windows xp PHP Version: 5.2.0RC1 -Assigned To: +Assigned To: pajoye New Comment: FETCH_INTO and FETCH_CLASS are not yet supported as default fetch mode. I will update the code to report the correct error. Previous Comments: ------------------------------------------------------------------------ [2006-07-29 18:14:50] stochnagara at hotmail dot com I get the same error when I use this: $pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, array (PDO::FETCH_CLASS, 'SimpleXMLElement')); ------------------------------------------------------------------------ [2006-07-29 18:06:33] stochnagara at hotmail dot com Description: ------------ PDO gives an inconsisten error message when I use the new PDO::ATTR_DEFAULT_FETCH_MODE in combination with PDO::FETCH_INTO. Reproduce code: --------------- <? $pdo = new PDO ('sqlite::memory:'); $pdo->exec ("create table test (id integer primary key, n text)"); $pdo->exec ("INSERT INTO test (n) VALUES ('hi')"); $pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, array (PDO::FETCH_INTO, $a)); $stmt = $pdo->prepare ("SELECT * FROM test"); $stmt->execute(); var_dump($stmt->fetchAll()); Expected result: ---------------- i don't know exactly Actual result: -------------- Warning: PDOStatement::fetchAll() [function.PDOStatement-fetchAll]: SQLSTATE[HY000]: General error: PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll() in ... on line 11 bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38252&edit=1

« previous php.bugs (#100064) next »