DB_Table

From: Date: Mon, 20 Nov 2006 12:55:57 +0000
Subject: DB_Table
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25883@lists.php.net to get a copy of this message
I'm using DB_Table like this: <?php require_once 'DB.php'; require_once 'DB/Table.php'; $dsn = 'mysql://root:root@localhost/mydatabase'; $db =& DB::connect($dsn); if (PEAR::isError($db)) { die($db->getMessage()); } $dbt = & new DB_Table($db,'mytable'); if ($dbt->error) { die($dbt->error->getMessage()); } ?> it always give me this error: Column definition array may not be empty Am i missing something here? because i check in DB/Table.php, i found this wiered lines in constructor:
      // array with column definition may not be empty
       if (! isset($this->col) || is_null($this->col) ||
               (is_array($this->col) && count($this->col) === 0)) {
           $this->error =& DB_Table::throwError(DB_TABLE_ERR_NO_COLS);
           return;
       }
which surely always throw error, since $this->col initially is empty, right? regards -ers

« previous php.pear.general (#25883) next »