Re: DataObject Inserts and Sequences
| From: | Justin Patrin | Date: | Thu, 26 Feb 2004 00:50:02 +0000 |
| Subject: | Re: DataObject Inserts and Sequences | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10942@lists.php.net to get a copy of this message | ||
Michael Kunze wrote:
hi, i have this simple code: $player_has_stats = new Player_has_stats(); $player_has_stats->player_id = 13; $player_has_stats->insert(); with debug enabled i get this: player_has_stats: CONNECT: USING CACHED CONNECTION player_has_stats: CONNECT: USING CACHED CONNECTION player_has_stats: QUERY: INSERT INTO player_has_stats (player_id ) VALUES ( 1 ) player_has_stats: query: QUERY DONE IN 0.000581979751587 seconds player_has_stats: 1: Clearing Cache for player_has_stats whats wrong here? why does it generate the sql statement with ...VALUES(1) ? i clearly said that player_id should be 13. CREATE TABLEWhen you have a field set as a primary key, DB_DataObject won't allow you to manually set it (I believe). Why are you trying to set the primary key manually? -- paperCrane <Justin Patrin>player_has_stats(player_idint(10) unsigned NOT NULL default '0',deathsint(10) unsigned NOT NULL default '0',killsint(10) unsigned NOT NULL default '0', PRIMARY KEY (player_id) ) TYPE=MyISAM; i'm using: $Id: DataObject.php,v 1.208 2004/01/29 09:53:18 alan_k Exp $ for some strange reason it tries to create a sequence for that table. i have absolut no idea why it tries todo that. please help. best regards, michael