ID: 38252 Updated by: [EMAIL PROTECTED] Reported By: stochnagara at hotmail dot com -Status: Open +Status: Assigned Bug Type: PDO related Operating System: windows xp PHP Version: 5.2.0RC1 Assigned To: pajoye
Previous Comments: ------------------------------------------------------------------------ [2006-07-29 18:23:28] [EMAIL PROTECTED] FETCH_INTO and FETCH_CLASS are not yet supported as default fetch mode. I will update the code to report the correct error. ------------------------------------------------------------------------ [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