Doc #51809 [Com]: Missing information in PDOStatement->fetchAll docs
| From: | frozenfire at thefrozenfire dot com | Date: | Sat, 23 Oct 2010 18:38:03 +0000 |
| Subject: | Doc #51809 [Com]: Missing information in PDOStatement->fetchAll docs | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5385@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51809&edit=1
ID: 51809
Comment by: frozenfire at thefrozenfire dot com
Reported by: smrank at zepler dot org
Summary: Missing information in PDOStatement->fetchAll docs
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.2
Block user comment: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2010-05-13 13:09:06] 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().
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51809&edit=1