#44475 [Opn->WFx]: PDO mysql does not support cursor
| From: | uw@php.net | Date: | Thu, 03 Jul 2008 16:13:42 +0000 |
| Subject: | #44475 [Opn->WFx]: PDO mysql does not support cursor | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-126246@lists.php.net to get a copy of this message | ||
ID: 44475
Updated by: uw@php.net
Reported By: alexmehal at gmail dot com
-Status: Open
+Status: Wont fix
Bug Type: PDO related
Operating System: Windows XP
PHP Version: 5.2.5
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2008-03-18 22:55:33] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44475&edit=1