php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44541 new feature in PDOStatement::fetchAll()
Submitted: 2008-03-26 20:27 UTC Modified: 2022-10-25 14:40 UTC
Votes:10
Avg. Score:3.8 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: 007NOT at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: PDO related
PHP Version: 5.2.5 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: 007NOT at gmail dot com
New email:
PHP Version: OS:

 

 [2008-03-26 20:27 UTC] 007NOT at gmail dot com
Description:
------------
>General error: PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()
It seems to me it will be usefull to have parameter fetch_style = PDO::FETCH_LAZY


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-15 15:17 UTC] jinmoku at hotmail dot com
I agreed, I tried with fetchAll(PDO::FETCH_CLASS, 'PDORow'), but it don't work too :(
 [2011-02-21 20:47 UTC] jani@php.net
-Package: Feature/Change Request +Package: PDO related -Operating System: +Operating System: *
 [2022-10-25 14:41 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2022-10-25 14:41 UTC] cmb@php.net
This cannot be implemented, because PDORow retrieves the column
values only when actually requested by the script, and if all rows
would have already been fetched, the columns of the last row would
be returned.  A more elaborate implementation which would navigate
the result set might be possible, if the driver supports
scrollable cursors, but it seems to me that many drivers don't,
and I doubt that it would actually be useful.  The whole point of
`FETCH_LAZY` is to keep memory consumption in the PHP process low,
and `::fetchAll()` already defeat that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 08:01:31 2024 UTC