Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Insert script failing


LinusIT - 9:37 am on Jan 28, 2011 (gmt 0)


Thanks rocknbill :)

Now you've pointed it out and I've looked at my create table script, it's obvious. Although in notepad the two do look quite similar. I made a start with inserting all the different models last night, was all going swimmingly but now I'm getting this error message:

SQL insert into `model` values (? , ? , ?) failed : Duplicate entry '127' for key 1


Insert Code:

INSERT INTO `model` (`manufacturer_id`, `model_name`) VALUES ('9', '126'),('9', '500'), ('9', 'Barchetta'), ('9', 'Brava'), ('9', 'Bravo'), ('9', 'Cinquecento'), ('9', 'Coupe'), ('9', 'Croma'), ('9', 'Doblo'), ('9', 'Fiorino'), ('9', 'Grand Punto'), ('9', 'Idea'), ('9', 'Marea'), ('9', 'Multipla'), ('9', 'Panda'), ('9', 'Punto'), ('9', 'Punto Evo'), ('9', 'Qubo'), ('9', 'Regata'), ('9', 'Scudo'), ('9', 'Sedici'), ('9', 'Seicento'), ('9', 'Stilo'), ('9', 'Strada'), ('9', 'Tempra'), ('9', 'Tipo'), ('9', 'Ulysse'), ('9', 'Uno');


The strange thing is, it inserted the first two rows, 126 & 500 but won't go any further. I've looked at the code over and over but can't see why it's failing.

I've emailed my host to see if they can help.


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4251919.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com