From:             randy at rcs-comp dot com
Operating system: Win XP
PHP version:      5.1.6
PHP Bug Type:     PDO related
Bug description:  PDO Scrolling cursors not available for Sqlite and don't work 
for Mysql

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 bug report at http://bugs.php.net/?id=39310&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39310&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39310&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39310&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39310&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39310&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39310&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39310&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39310&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39310&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39310&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39310&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39310&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39310&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39310&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39310&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39310&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39310&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39310&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39310&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39310&r=mysqlcfg

Reply via email to