#39310 [Opn->Asn]: PDO Scrolling cursors not available for Sqlite and don't work for Mysql

From: Date: Wed, 08 Nov 2006 14:46:50 +0000
Subject: #39310 [Opn->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-104605@lists.php.net to get a copy of this message
ID: 39310 Updated by: tony2001@php.net Reported By: randy at rcs-comp dot com -Status: Open +Status: Assigned Bug Type: PDO related Operating System: Win XP PHP Version: 5.1.6 -Assigned To: +Assigned To: wez 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

« previous php.bugs (#104605) next »