|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79940 Cannot re-fetch rows in PDO
Submitted: 2020-08-06 22:03 UTC Modified: 2020-08-09 12:13 UTC
From: guana dot histark at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: PDO MySQL
PHP Version: 8.0.0beta1 OS: Linux
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 !
Your email address:
Solve the problem:
34 - 21 = ?
Subscribe to this entry?

 [2020-08-06 22:03 UTC] guana dot histark at gmail dot com
PDO::FETCH_ORI_ABS is not working for mariadb

Test script:
while($row = $stmt->fetch(PDO::FETCH_ASSOC,PDO::FETCH_ORI_ABS,0))


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-06 22:17 UTC]
-Status: Open +Status: Feedback
 [2020-08-06 22:17 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2020-08-07 05:42 UTC] guana dot histark at gmail dot com
-Status: Feedback +Status: Open
 [2020-08-07 05:42 UTC] guana dot histark at gmail dot com

$stmt = $conn->prepare("SELECT 1 FROM TABLE WHERE ID = 1");

while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
   echo "First fetch \n";

while($row = $stmt->fetch(PDO::FETCH_ASSOC,PDO::FETCH_ORI_ABS,0)){
   echo "Second fetch \n";

 [2020-08-07 13:40 UTC]
$stmt = $conn->prepare("SELECT 1 FROM TABLE WHERE ID = 1");

should likely be

$stmt = $conn->prepare("SELECT 1 FROM TABLE WHERE ID = 1", [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL]);
 [2020-08-07 22:17 UTC] guana dot histark at gmail dot com

But it the bug still persist.
 [2020-08-09 12:10 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2020-08-09 12:10 UTC]
I noticed that this is actually a duplicate of bug #63466.
 [2020-08-09 12:13 UTC] guana dot histark at gmail dot com
Yes, I have seen that too. But have not been fix since. Its PHP 8 now in beta :)
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 13:03:48 2023 UTC