Re: DB_DataObject_FormBuilder- Multi-Key Tables

From: Date: Tue, 04 Jan 2005 16:41:36 +0000
Subject: Re: DB_DataObject_FormBuilder- Multi-Key Tables
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16591@lists.php.net to get a copy of this message
Alternatively, you can specify this option in your dataobject.ini (or whatever your main configuration file for DO is called): ignore_sequence_keys = region_languages This should stop DO from trying to find a key to use with a numeric sequence. Maybe it works, maybe not. No guarantees here ;-) However, I concur with Justin tht a dedicated numeric keys more often than not comes in very handy - you can still set the other fields to UNIQUE to make sure each combination can occur only once. CU Markus Justin Patrin wrote:
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!


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