Re: DB_Table
| From: | Mark Wiesemann | Date: | Mon, 20 Nov 2006 13:06:10 +0000 |
| Subject: | Re: DB_Table | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25884@lists.php.net to get a copy of this message | ||
Hi Eris,
Eris Ristemena wrote:
> 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');
That's wrong. You need to define a subclass of the DB_Table class and
define your columns in the $col property in this subclass.
Please refer to http://wiki.ciaweb.net/yawiki/index.php?area=DB_Table
for more information / documentation (although it shows an old release
number the information given there is still true).
Regards,
Mark