#19108 [Csd]: DB_Result::tableInfo() docs misleading
| From: | alexmerz@php.net | Date: | Tue, 27 Aug 2002 08:25:33 +0000 |
| Subject: | #19108 [Csd]: DB_Result::tableInfo() docs misleading | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8680@lists.php.net to get a copy of this message | ||
ID: 19108
Updated by: alexmerz@php.net
Reported By: stephan@wanderinghorse.net
Status: Closed
Bug Type: PEAR related
Operating System: n/a
PHP Version: 4.2.0
New Comment:
DB_Result::tableInfo() is marked as deprecated, so it is not in the new
manual.
Previous Comments:
------------------------------------------------------------------------
[2002-08-27 04:10:55] stephan@wanderinghorse.net
Correct, it doesn't indicate static behaviour, but it does
say that it accepts a DB_Result object as it's first
parameter, and that's not the case. i checked out the
draft link below but could not find DB_Result::tableInfo()
in the list
(http://www-user.tu-chemnitz.de/~meal/php/peardoc2/package.database.html).
------------------------------------------------------------------------
[2002-08-27 03:18:56] alexmerz@php.net
Every entry headline is written as Package::Function. It does not
indicate any static behavior.
Peardoc 2 will clearifed this. See Draft on
http://www-user.tu-chemnitz.de/~meal/php/peardoc2/
------------------------------------------------------------------------
[2002-08-26 11:37:05] stephan@wanderinghorse.net
DB_Result::tableInfo() docs say as follows:
------------------
DB_Result::tableInfo() -- returns meta data about the
result set
Description
mixed tableInfo (DB_Result $result [, mode $mode])
...
------------------
That is misleading, however: it cannot be called
statically.
$res = $db->query( "select foo from bar" );
DB_Result::tableInfo( $res );
fails with "Fatal error: Call to a member function on a
non-object in DB.php on line 828"
It must be called on an object:
$res = $db->query( "select * from hits where false" );
$ar = $res->tableInfo();
print_r( $ar );
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19108&edit=1