|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-22 21:11 UTC] sjoerd@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
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