Re: DB_Table:
| From: | Mark Wiesemann | Date: | Fri, 02 Feb 2007 21:37:51 +0000 |
| Subject: | Re: DB_Table: | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26490@lists.php.net to get a copy of this message | ||
l Burnerheimerton wrote:
> I am trying to follow the example in documentation for
> DB_Table and am having trouble.
>
> Here's my table:
>
> CREATE TABLE
news (
> news_id varchar(32) NOT NULL default '',
> title varchar(100) NOT NULL default '',
> article varchar(100) NOT NULL default '',
> PRIMARY KEY (news_id)
> )
Just as a note: DB_Table can create the table for you. (Useful only if
it does not exist yet, of course.)
> My news_id is, by habit, created a random_gen function
> which is why it's varchar(32).
>
> Here's my class:
> <?php
> class news extends DB_Table {
> var $col = array(
> // unique row ID
> 'news_id' => array(
> 'type' => 'varchar',
> 'require' => 32
> ),
Maybe you wanted to use
'size' => 32,
'require' => true
here?
Regards,
Mark
--
http://www.markwiesemann.eu