Re: Bug in DB::tableInfo
| From: | Tomas V.V.Cox | Date: | Sun, 25 Aug 2002 12:19:08 +0000 |
| Subject: | Re: Bug in DB::tableInfo | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8644@lists.php.net to get a copy of this message | ||
Alex Boyer wrote:
>
> There is a bug in DB::tableInfo with the mysql implementation in mysql.php,v 1.89.2.1
> 2002/04/09 19:04:14
> method DB::tableInfo($result, $mode) with $result as a DB_Result (see manual) and $mod as
> int/bool
> But, in source code $result is considered as a mysql id, so as a DB_Result->result
> Solution: correct the bug or call like this : $db->tableInfo($result->result, $mode);
> Regards
This is not correct. To use tableInfo you should:
1) Get info from a table:
$db = DB::connect();
print_r($db->tableInfo('my_table'));
2) Get info from a result:
$db = DB::connect();
$res = $db->query('select * from my_table');
print_r($res->tableInfo());
Tomas V.V.Cox