From: Ulf H. <U1...@ul...> - 2004-10-14 17:28:23
|
Tony, uhm -- am i mistaken or is this a column order issue? On a first look, I believe you got what you asked for. Possible solution: Re-order the values in the insert statement, or add the designated columns names to the insert statement. I apologize if this answer too simple b/c I did not undertand your problem. ;) Ulf PS: I wonder why this list keeps telling me that my mails have a suspicious header. Is this because I am asking dumb questions or because I am writing stupid answers.....? Miller wrote: >I have kind of a strange one, and I'm wondering if it's a bug, or if I'm >just doing something stupid. > >I am deep into the Cigar Diary conversion, and it's going quite well. I >think I'm going to be REALLY pleased when it's finished, but I've come to >a little speed bump. > >I create the cigar table and then I insert one line into it. This is >supposed to be the "cigar not designated" entry, but install will not >create this record properly. Here is my install.sql code for this: > >## >CREATE TABLE mod_cigardiary_cigar ( > id int NOT NULL default '0', > owner varchar(20) default NULL, > editor varchar(20) default NULL, > ip text, > label text NOT NULL, > created int NOT NULL default '0', > updated int NOT NULL default '0', > hidden smallint NOT NULL default '1', > approved smallint NOT NULL DEFAULT '0', > active smallint NOT NULL DEFAULT '0', > brand varchar(30) NOT NULL, > style varchar(30) NOT NULL, > shape varchar(30), > origin smallint(5) unsigned, > wrapper int(10) unsigned, > binder int(10) unsigned, > filler int(10) unsigned, > color smallint(5) unsigned, > ring smallint(5) unsigned, > length smallint(5) unsigned, > PRIMARY KEY (id) >); > >INSERT INTO mod_cigardiary_cigar >VALUES (0, 'Install', 'Install', '0.0.0.0', 'Not Designated', > UNIX_TIMESTAMP(),UNIX_TIMESTAMP(), 0, 1, 1, 'Not Designated', > 'Not Designated', 'Not Designated', 0, 0, 0, 0, 0, 0, 0); >## > >This looks to me, ok. When I issue the install, I get the following >listing: > >## >List of Cigars > ID Label Owner Editor Created Updated Hidden Approved > 1 0.0.0.0 0 Install 12/31/1969 07:00 12/31/1969 07:00 Hidden Approved >## > >Everything appears to be shifted one to the right, and the dates are all >wrong. > >When I check the actual table contents, I get this: > >## >mysql> select * from cd_mod_cigardiary_cigar; >+----+-------+---------+---------+---------+---------+---------+--------+----------+--------+----------------+----------------+-------+--------+---------+--------+--------+-------+------+--------+ >| id | owner | editor | ip | label | created | updated | hidden | >approved | active | brand | style | shape | origin | >wrapper | binder | filler | color | ring | length | >+----+-------+---------+---------+---------+---------+---------+--------+----------+--------+----------------+----------------+-------+--------+---------+--------+--------+-------+------+--------+ >| 1 | NULL | Install | Install | 0.0.0.0 | 0 | 0 | 1 | >1 | 0 | Not Designated | Not Designated | 0 | 0 | 0 | >0 | 0 | 0 | 0 | NULL | >+----+-------+---------+---------+---------+---------+---------+--------+----------+--------+----------------+----------------+-------+--------+---------+--------+--------+-------+------+--------+ >1 row in set (0.00 sec) >## > >This is NOT what I asked for. When I cut and paste the line into MySQL >(adding the cd_ to the table name) it works perfectly. > >This is not a major issue, since I can create the record easily by hand, >but I don't think I should have to. Did I do something wrong, and if so, >what is it? > >Thanks, > >-Tony > > > |