#39310 [Asn]: PDO Scrolling cursors not available for Sqlite and don't work for Mysql
| From: | randy at rcs-comp dot com | Date: | Thu, 16 Nov 2006 22:39:15 +0000 |
| Subject: | #39310 [Asn]: PDO Scrolling cursors not available for Sqlite and don't work for Mysql | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105126@lists.php.net to get a copy of this message | ||
ID: 39310
User updated by: randy at rcs-comp dot com
Reported By: randy at rcs-comp dot com
Status: Assigned
Bug Type: PDO related
Operating System: Win XP
PHP Version: 5.1.6
Assigned To: wez
New Comment:
For what it is worth, I have confirmed that this continues to be a
problem in version 5.2.0.
Previous Comments:
------------------------------------------------------------------------
[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 documentation 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
>php 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