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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Mar 19 03:01:29 2024 UTC