Bug #79940 [Dup]: Cannot re-fetch rows in PDO
| From: | guana dot histark at gmail dot com | Date: | Sun, 09 Aug 2020 12:13:26 +0000 |
| Subject: | Bug #79940 [Dup]: Cannot re-fetch rows in PDO | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228469@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79940&edit=1
ID: 79940
User updated by: guana dot histark at gmail dot com
Reported by: guana dot histark at gmail dot com
Summary: Cannot re-fetch rows in PDO
Status: Duplicate
Type: Bug
Package: PDO MySQL
Operating System: Linux
PHP Version: 8.0.0beta1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Yes, I have seen that too. But have not been fix since. Its PHP 8 now in beta :)
Previous Comments:
------------------------------------------------------------------------
[2020-08-09 12:10:21] cmb@php.net
I noticed that this is actually a duplicate of bug #63466.
------------------------------------------------------------------------
[2020-08-07 22:17:40] guana dot histark at gmail dot com
I tried with [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL]
But it the bug still persist.
------------------------------------------------------------------------
[2020-08-07 13:40:54] cmb@php.net
$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 05:42:10] guana dot histark at gmail dot com
<?php
$stmt = $conn->prepare("SELECT 1 FROM TABLE WHERE ID = 1");
$stmt->execute();
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-06 22:17:19] requinix@php.net
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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79940
--
Edit this bug report at https://bugs.php.net/bug.php?id=79940&edit=1