php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51809 Missing information in PDOStatement->fetchAll docs
Submitted: 2010-05-13 13:09 UTC Modified: 2010-10-25 19:10 UTC
From: smrank at zepler dot org Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
 [2010-05-13 13:09 UTC] smrank at zepler dot org
Description:
------------
On the following page for PDOStatement->fetchAll, the text leaves out some pretty important information:

http://uk2.php.net/manual/en/pdostatement.fetchall.php

If the first argument is PDO::FETCH_COLUMN then the second argument is treated as the column index (this is mentioned on the page). However, if the first argument is PDO::FETCH_CLASS then the second argument is treated as the class name, this is not mentioned at all as far as I can see. The page does say that these fetch styles are documented on the fetch() page but that doesn't help since AFAICS fetch() doesn't allow the class name to be specified as the second argument, that feature is specific to fetchAll().



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-23 20:38 UTC] frozenfire at thefrozenfire dot com
In the source for the PDOStatement class, in the PDO extension (http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo/pdo_stmt.c?view=markup#l1422), the naming of the second argument is ambiguous. The proto refers to it as "string class_name", and the method's code refers to it as arg2.

In the documentation, I suggest we rename that argument to "mixed $index_or_classname" with some indication of the default value for each PDO::FETCH_* type.
 [2010-10-25 19:10 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304883
Log: Fixed bug #51809 (Missing information in PDOStatement->fetchAll docs)
 [2010-10-25 19:10 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-25 19:10 UTC] kalle@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.


 [2015-10-08 15:44 UTC] chealer at gmail dot com
More fixes to PDOStatement::fetchAll have been requested in ticket #70672.
 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e12a44b36935e90bf1074a51a6db52bc871912cf
Log: Fixed bug #51809 (Missing information in PDOStatement->fetchAll docs)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 03:02:51 2024 UTC