php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #40489 Invalid example 1681. Fetching rows with a scrollable cursor
Submitted: 2007-02-14 23:54 UTC Modified: 2007-03-23 16:59 UTC
From: baldurien at bbnwn dot eu Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: baldurien at bbnwn dot eu
New email:
PHP Version: OS:

 

 [2007-02-14 23:54 UTC] baldurien at bbnwn dot eu
Description:
------------
In the example 1681 (here:  http://www.php.net/manual/en/function.PDOStatement-fetch.php) we can read this :

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

[later in the example]

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

But the doc for PDO::prepare() (here: http://www.php.net/manual/en/function.PDO-prepare.php ) says :

driver_options

"This array holds one or more key=>value pairs to set attribute values for the PDOStatement object that this method returns. You would most commonly use this to set the PDO::ATTR_CURSOR value to PDO::CURSOR_SCROLL to request a scrollable cursor. Some drivers have driver specific options that may be set at prepare-time."

Thus, it should be for the two lines.

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





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-23 16:59 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC