ID:               44646
 Updated by:       [EMAIL PROTECTED]
 Reported By:      getmequick at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PDO related
 Operating System: win XP
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You can only consume a result set *once*.


Previous Comments:
------------------------------------------------------------------------

[2008-04-05 12:38:15] getmequick at gmail dot com

Description:
------------
Fetching rows using different fetch styles works for single
PDO::fetch() method, as shown here -
http://www.php.net/manual/ru/function.PDOStatement-fetch.php

Hovewer it doesn't work for PDO::fetchAll() method

Reproduce code:
---------------
<?php
$sth = $dbh->prepare("SELECT domain_name, domain_id FROM
pub_domains");
$sth->execute();

print_r($sth->fetchAll(PDO::FETCH_ASSOC));
print_r($sth->fetchAll(PDO::FETCH_BOTH));
?>

Expected result:
----------------
<?php
Array
(
    [0] => Array
        (
            [DOMAIN_NAME] => apple.com
            [DOMAIN_ID] => 3
        )

)

Array
(
    [0] => Array
        (
            [DOMAIN_NAME] => apple.com
            [0] => apple.com
            [DOMAIN_ID] => 3
            [1] => 3
        )

)
?>

Actual result:
--------------
<?php
Array
(
    [0] => Array
        (
            [DOMAIN_NAME] => apple.com
            [DOMAIN_ID] => 3
        )

)

Array
(
)
?>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44646&edit=1

Reply via email to