|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-09-24 06:35 UTC] stewey at ambitious dot ca
Description:
------------
Preparing a statement with the PDO_ATTR_CURSOR =>
PDO_CURSOR_SCROLL driver option doesn't work with MySQL.
Reproduce code:
---------------
$PDO = new PDO(
"mysql:dbname=test;host=127.0.0.1",
'user', 'pass' );
$statement = $PDO->prepare("select id from table",
array(PDO_ATTR_CURSOR => PDO_CURSOR_SCROLL) );
$statement->execute();
print_r($statement->fetch( PDO_FETCH_ASSOC,
PDO_FETCH_ORI_ABS, 1 ));
print_r($statement->fetch( PDO_FETCH_ASSOC,
PDO_FETCH_ORI_ABS, 1 ));
exit;
Expected result:
----------------
I would expect to see the same row output twice. If this is
not a support driver option, then I would expect and error or
exception thrown (yes, exceptions are enabled).
Actual result:
--------------
Two different rows. The PDO_FETCH_ORI_ABS arguments are
seemingly ignored.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
Thanks for the info. Constant problem resolved, but the scrollable cursor problem remains. New repro code: $PDO = new PDO( "mysql:dbname=test;host=127.0.0.1", 'user', 'pass' ); $statement = $PDO->prepare("select id from table", array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) ); $statement->execute(); print_r($statement->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, 1 )); print_r($statement->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, 1 )); exit;