#38252 [Opn]: Incorrect PDO error message

From: Date: Sat, 29 Jul 2006 18:14:51 +0000
Subject: #38252 [Opn]: Incorrect PDO error message
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100063@lists.php.net to get a copy of this message
ID: 38252 User updated by: stochnagara at hotmail dot com Reported By: stochnagara at hotmail dot com Status: Open Bug Type: PDO related Operating System: windows xp PHP Version: 5.2.0RC1 New Comment: I get the same error when I use this: $pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, array (PDO::FETCH_CLASS, 'SimpleXMLElement')); Previous Comments: ------------------------------------------------------------------------ [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 (#100063) next »