php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19108 DB_Result::tableInfo() docs misleading
Submitted: 2002-08-26 11:37 UTC Modified: 2002-08-27 04:25 UTC
From: stephan at wanderinghorse dot net Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.2.0 OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stephan at wanderinghorse dot net
New email:
PHP Version: OS:

 

 [2002-08-26 11:37 UTC] stephan at wanderinghorse dot 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 );  
  
   
   
   
    

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-27 03:18 UTC] 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-27 04:10 UTC] stephan at wanderinghorse dot 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 04:25 UTC] alexmerz@php.net
DB_Result::tableInfo() is marked as deprecated, so it is not in the new manual.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC