|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44475 PDO mysql does not support cursor
Submitted: 2008-03-18 22:55 UTC Modified: 2008-07-03 16:13 UTC
Avg. Score:4.8 ± 0.5
Reproduced:17 of 17 (100.0%)
Same Version:4 (23.5%)
Same OS:6 (35.3%)
From: alexmehal at gmail dot com Assigned:
Status: Wont fix Package: PDO related
PHP Version: 5.2.5 OS: Windows XP
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.
Block user comment
Status: Assign to:
Bug Type:
From: alexmehal at gmail dot com
New email:
PHP Version: OS:


 [2008-03-18 22:55 UTC] alexmehal at gmail dot com
I'm trying to use different types of cursor orientations. Even example from official manual does not work.

Reproduce code:
$dsn = 'mysql:dbname=...';
$dbh = new PDO($dsn, $user, $password);

$sql = "SELECT * FROM genres WHERE 1 ORDER BY id";

$stmt = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_LAST);
do {
  $data = $row[0] . "\t" . $row[1] . "\t" . $row[2] . "\n";
  print $data;
} while ($row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_PRIOR));

$stmt = null;

Expected result:
3	Fighting	
2	Arcade/Puzzle	
1	Action/Adventure	

Actual result:
1	Action/Adventure	
2	Arcade/Puzzle	
3	Fighting	


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-03 16:13 UTC]
Thanks for the hint! Currently its not planned to add support for cursor features to PDO_MYSQL or PDO_MYSQLND. However, feel free to provide a patch.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 06:01:30 2024 UTC