php.net |  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
Votes:20
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alexmehal at gmail dot com
New email:
PHP Version: OS:

 

 [2008-03-18 22:55 UTC] alexmehal at gmail dot com
Description:
------------
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));
$stmt->execute();
$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	



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-03 16:13 UTC] uw@php.net
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: Thu Dec 26 13:01:30 2024 UTC