Skip to content

PDO_MySQL does not support cursors #1883

@1107012776

Description

@1107012776

Description

For example, I have a table with two fields: id and value. I inserted nearly 100k rows into this table.
I want to use the scrollable cursor. I wrote the following code:

$sql = 'SELECT id FROM cursor_ test;';
$stmt = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$stmt ->Execute ();
$row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, 3);
var_ dump($row['id']); // 1, the expected value is 3

What did I do wrong?

PHP Version

PHP5.6.25

Operating System

window7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Extension: pdoAll PDO related doc issuesbugDocumentation contains incorrect information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions