Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #39310 : PDO Scrolling cursors not available for Sqlite and don't work for Mysql
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 4th July 09:25
php-bugs
External User
 
Posts: 1
Default #39310 : PDO Scrolling cursors not available for Sqlite and don't work for Mysql



ID: 39310
User updated by: randy at rcs-comp dot com
Reported By: randy at rcs-comp dot com
Status: Bogus
Bug Type: PDO related
Operating System: Win XP
PHP Version: 5.1.6
New Comment:

Is there anywhere in the do***entation that describes what database
drivers support this? Or, is there a way to tell programatically?

Thanks.


Previous Comments:
------------------------------------------------------------------------

[2006-12-04 02:30:50] iliaa@php.net

Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is because cursors are only supported in instance where
the underlying database provides such functionality. In the
case of MySQL and SQLite there is no such support. PDO does
not provide emulation for cursors.

------------------------------------------------------------------------

[2006-11-16 22:39:15] randy at rcs-comp dot com

For what it is worth, I have confirmed that this continues to be a
problem in version 5.2.0.

------------------------------------------------------------------------

[2006-10-30 16:23:31] randy at rcs-comp dot com

Sorry, reproduce code file is here:

http://www.rcs-comp.com/tmp/simple_pdo_test.php.txt

------------------------------------------------------------------------

[2006-10-30 16:21:49] randy at rcs-comp dot com

Description:
------------
When trying to make the scrolling cursor example found here:

http://us2.php.net/manual/en/function.pdostatement-fetch.php

under Example 2 to work, I could not. Note that I am unsure of which
way I should use the prepare statement. The example uses this:

$stmt = $dbh->prepare($sql, array(PDO::ATTR_CURSOR,
PDO::CURSOR_SCROLL));

But based on the do***entation here:

http://us2.php.net/manual/en/function.pdo-prepare.php

It seems that this would make more sense (the driver options are in an
associative array:

$stmt = $dbh->prepare($sql, array(PDO::ATTR_CURSOR =>
PDO::CURSOR_SCROLL));

Note that I have tried both methods for both Sqlite and MySQL. The
results are as follows:

MySql w/ example array: returns object but scrolling does not work.
MySql w/ associative array: returns object but scrolling does not
work.
SQLite w/ example array: returns object but scrolling does not work.
SQLite w/ associative array: returns FALSE


Reproduce code:
---------------
Example file can be found here:

http://www.rcs-comp.com/tmp/simple_pdo_test.php


Expected result:
----------------
connections created
tables created: 0 0
tables filled
user3 user3@example.com 1162224979
user2 user2@example.com 1162224979
user1 user1@example.com 1162224979
object(PDOStatement)#3 (1) {
["queryString"]=>
string(53) "SELECT user, email, time FROM testtable ORDER BY user"
}
user3 user3@example.com 1162224979
user2 user2@example.com 1162224979
user1 user1@example.com 1162224979
user3 user3@example.com 1162224979
user2 user2@example.com 1162224979
user1 user1@example.com 1162224979
rows updated: 3 3
rows deleted: 3 3
tables droped: 3 0

Actual result:
--------------
connections created
tables created: 0 0
tables filled
user1 user1@example.com 1162224979
user2 user2@example.com 1162224979
user3 user3@example.com 1162224979
bool(false)
user1 user1@example.com 1162224979
user2 user2@example.com 1162224979
user3 user3@example.com 1162224979
user1 user1@example.com 1162224979
user2 user2@example.com 1162224979
user3 user3@example.com 1162224979
rows updated: 3 3
rows deleted: 3 3
tables droped: 3 0


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=39310&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666