#49017 [Opn->Bgs]: PDO::FETCH_ORI_REL not working

From: Date: Tue, 22 Sep 2009 21:11:39 +0000
Subject: #49017 [Opn->Bgs]: PDO::FETCH_ORI_REL not working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142725@lists.php.net to get a copy of this message
ID: 49017 Updated by: sjoerd@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

« previous php.bugs (#142725) next »