Re: DB_DataObject_FormBuilder- Multi-Key Tables
| From: | Justin Patrin | Date: | Tue, 04 Jan 2005 15:48:17 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder- Multi-Key Tables | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16586@lists.php.net to get a copy of this message | ||
DB_DataObject does not support multi-column keys, therefore
DB_DataObject_FormBuilder also does not. You would be better off using
an auto-incremented field as your primary key. You can always set up
those two as a unique key to keep the semantics the same.
UNIQUE(
region_id, language_language),
KEY(region_id, language_language),
On Tue, 04 Jan 2005 02:45:49 -0800, Ed Greenberg <edg@greenberg.org> wrote:
> I have a table like:
>
> CREATE TABLE region_languages (
> region_id int(10) unsigned NOT NULL default '0',
> language_language char(2) NOT NULL default '',
> textstring varchar(255) default NULL,
> PRIMARY KEY
> (region_id,language_language),
> KEY region_languages_FKIndex1
> (region_id),
> KEY region_languages_FKIndex2
> (language_language)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
>
> Given that there are two primary keys which must be chosen, along with a
> textstring to be entered, can I use DB_DataObject_FormBuilder to generate a
> form for inserting into this table?
>
> Can you point me at a working example, or a few lines of code?
>
> </edg>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:41da764468885399153354!
>
>
--
Justin Patrin