ID: 39310 Updated by: [EMAIL PROTECTED] Reported By: randy at rcs-comp dot com -Status: Assigned +Status: Bogus Bug Type: PDO related Operating System: Win XP PHP Version: 5.1.6 Assigned To: wez New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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 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 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user1 [EMAIL PROTECTED] 1162224979 object(PDOStatement)#3 (1) { ["queryString"]=> string(53) "SELECT user, email, time FROM testtable ORDER BY user" } user3 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user1 [EMAIL PROTECTED] 1162224979 user3 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user1 [EMAIL PROTECTED] 1162224979 rows updated: 3 3 rows deleted: 3 3 tables droped: 3 0 Actual result: -------------- connections created tables created: 0 0 tables filled user1 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user3 [EMAIL PROTECTED] 1162224979 bool(false) user1 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user3 [EMAIL PROTECTED] 1162224979 user1 [EMAIL PROTECTED] 1162224979 user2 [EMAIL PROTECTED] 1162224979 user3 [EMAIL PROTECTED] 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