#44646 [NEW]: next calls of fetchAll method return empty array
| From: | getmequick at gmail dot com | Date: | Sat, 05 Apr 2008 12:38:15 +0000 |
| Subject: | #44646 [NEW]: next calls of fetchAll method return empty array | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-123986@lists.php.net to get a copy of this message | ||
From: getmequick at gmail dot com
Operating system: win XP
PHP version: 5.2.5
PHP Bug Type: PDO related
Bug description: next calls of fetchAll method return empty array
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 bug report at http://bugs.php.net/?id=44646&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44646&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44646&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44646&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44646&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44646&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44646&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44646&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44646&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44646&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44646&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44646&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44646&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44646&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44646&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44646&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44646&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44646&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44646&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44646&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44646&r=mysqlcfg