|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49017 PDO::FETCH_ORI_REL not working
Submitted: 2009-07-22 14:25 UTC Modified: 2009-09-22 21:11 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: farkasmate_ at freemail dot hu Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.3.0 OS: win XP sp2
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: farkasmate_ at freemail dot hu
New email:
PHP Version: OS:


 [2009-07-22 14:25 UTC] farkasmate_ at freemail dot hu
pdo mysql error.
PDO::FETCH_ORI_REL not working

sql result about 1000 rows.
I need to catch 555. row item but i get always first row (0.) of result.

Reproduce code:
$this->db_conn = new PDO("mysql:host=$db;dbname=mysql;EnableScrollableCursors=1",$db_username,$db_password);//connect mysql
$sql = "select * from tablename";
$this->db_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
//$stmt = $this->db_conn->query($sql) or die("ERROR: " . implode(":", $this->db_conn->errorInfo()));
$stmt = $this->db_conn->prepare($sql,  array( PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL )	);
$search_row = 555;
$row = $stmt->fetch(PDO::FETCH_NUM , PDO::FETCH_ORI_REL, $search_row );

Expected result:
catch 555. row

Actual result:
catch first row


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 21:11 UTC]
Thank you for your bug report.

Unfortunately, MySQL does not support scrollable cursors.

See also:
Bug #39310 PDO Scrolling cursors not available for Sqlite and don't work for Mysql
Bug #34625 Scrollable cursor doesn't work with MySQL
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 10:01:29 2024 UTC