Re: Re: DB_Table:
| From: | l Burnerheimerton | Date: | Mon, 05 Feb 2007 15:35:30 +0000 |
| Subject: | Re: Re: DB_Table: | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26505@lists.php.net to get a copy of this message | ||
--- Mark Wiesemann <wiesemann@php.net> wrote:
> 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
The "require" was the problem - thanks! for pointing
it out!
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097