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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vtsupermok at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC