|  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
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
34 + 16 = ?
Subscribe to this entry?

 [2008-03-26 20:27 UTC] 007NOT at gmail dot com
>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


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


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]
-Package: Feature/Change Request +Package: PDO related -Operating System: +Operating System: *
 [2022-10-25 14:41 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2022-10-25 14:41 UTC]
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: Mon Jul 15 02:01:28 2024 UTC