Re: DataObject Inserts and Sequences

From: Date: Fri, 27 Feb 2004 00:00:33 +0000
Subject: Re: DataObject Inserts and Sequences
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10981@lists.php.net to get a copy of this message
Michael Kunze wrote:
Justin Patrin wrote:
When you have a field set as a primary key, DB_DataObject won't allow you to manually set it (I believe).
to contradict your statement the really strange thing is: i'm doing almost the same with a different table. CREATE TABLE player_not_visited_sector ( player_id smallint(6) unsigned NOT NULL default '0', sector_id smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (player_id,sector_id) ) TYPE=MyISAM; $player_not_visited_sector = new Player_not_visited_sector(); $player_not_visited_sector->player_id = 13; $player_not_visited_sector->sector_id = 100; $player_not_visited_sector->insert(); player_not_visited_sector: CONNECT: USING CACHED CONNECTION player_not_visited_sector: CONNECT: USING CACHED CONNECTION player_not_visited_sector: QUERY: INSERT INTO player_not_visited_sector (player_id , sector_id ) VALUES ( 13 , 100 ) player_not_visited_sector: query: QUERY DONE IN 0.000319004058838 seconds player_not_visited_sector: 1: Clearing Cache for player_not_visited_sector and it works! that drives me crazy. the only difference i can see here is that i fill all columns for that table. for the previous i just fill in the primary key. anyway it shouldn't make any difference. ALAN?!? be my saver! *g*
By default, DB_DataObject automatically uses the first key as a sequence...which is very strange to me. Perhaps this should be submitted as a bug. -- paperCrane <Justin Patrin>

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