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

Reply via email to