php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44576 fetchall more than one times
Submitted: 2008-03-31 10:41 UTC Modified: 2008-03-31 10:43 UTC
From: vtsupermok at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.5 OS: win
Private report: No CVE-ID: None
 [2008-03-31 10:41 UTC] vtsupermok at gmail dot com
Description:
------------
I have try to ext a PDO object, and then fetch a PDO result set more than 1 time, the result is the first time result contains record, after that, it has no records. Is it a bug or not?





Reproduce code:
---------------
$resultSet=$result->fetchAll(PDO::FETCH_ASSOC);
var_dump($resultSet);

$resultSet2=$result->fetchAll(PDO::FETCH_ASSOC);
var_dump($resultSet2);


Expected result:
----------------
array(1) { [0]=>  array(5) { ["userID"]=>  string(1) "1" ["userName"]=>  string(5) "admin" ["alias"]=>  string(5) "Admin" ["groupID"]=>  string(1) "0" ["lstLoginTime"]=>  string(19) "2008-03-31 11:38:23" } } 

array(1) { [0]=>  array(5) { ["userID"]=>  string(1) "1" ["userName"]=>  string(5) "admin" ["alias"]=>  string(5) "Admin" ["groupID"]=>  string(1) "0" ["lstLoginTime"]=>  string(19) "2008-03-31 11:38:23" } } 

Actual result:
--------------
array(1) { [0]=>  array(5) { ["userID"]=>  string(1) "1" ["userName"]=>  string(5) "admin" ["alias"]=>  string(5) "Admin" ["groupID"]=>  string(1) "0" ["lstLoginTime"]=>  string(19) "2008-03-31 11:38:23" } } 

array(0) { }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-31 10:43 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Not a bug, it\'s meant like this.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Mar 02 14:01:23 2021 UTC