From: alexmehal at gmail dot com
Operating system: Windows XP
PHP version: 5.2.5
PHP Bug Type: PDO related
Bug description: PDO mysql does not support cursor
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 bug report at http://bugs.php.net/?id=44475&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44475&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44475&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44475&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44475&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44475&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44475&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44475&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44475&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44475&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44475&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44475&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44475&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44475&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44475&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44475&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44475&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44475&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44475&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44475&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44475&r=mysqlcfg