ID: 49017 Updated by: sjo...@php.net Reported By: farkasmate_ at freemail dot hu -Status: Open +Status: Bogus Bug Type: PDO related Operating System: win XP sp2 PHP Version: 5.3.0 New Comment:
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 Previous Comments: ------------------------------------------------------------------------ [2009-07-22 14:25:39] farkasmate_ at freemail dot hu Description: ------------ 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 ) ); $stmt->execute(); $search_row = 555; $row = $stmt->fetch(PDO::FETCH_NUM , PDO::FETCH_ORI_REL, $search_row ); var_dump($row); Expected result: ---------------- catch 555. row Actual result: -------------- catch first row ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49017&edit=1