Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1062 - Duplicate entry '1' for key 1


Flotec

Recommended Posts

I get this message when I try to reload the database.

 

1062 - Duplicate entry '1' for key 1

 

insert into topics (topics_id, topics_image, parent_id, sort_order, date_added, last_modified) values ('1', NULL, '0', '1', '2012-08-26 21:27:57', '2012-08-27 22:14:54')

 

I understand it's something wrong in the database. I have tried to clear the topics_id but that does not help.

Link to comment
Share on other sites

You're getting that error because you are trying to add a row to the table when that row already exists. You need to first Truncate (Empty) that table, then you can add all the entries back in. Warning: Make a backup of your database before doing this. All data in that table will be lost.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have truncated the table. It's the same message. I have deleted the table and I have the same message. I have checked it's the same database I work with.

 

The thing is that I want to move the whole 2.3.3 shop to another place. On that new place I first setup a 2.3.1 shop using Fantastico. I then uploaded all new files from the 2.3.3 shop and then went into admin and tried to update the database with the content of the moved database. Never done that before but thought it should be easy.

Link to comment
Share on other sites

Something is wrong there. You can't be getting that message if the table is empty, and you would get a different error message if the table was completely missing. That can't be the correct database.

 

I would not use the Fantastico installer. It's not reliable. Delete everything, upload the files from the 2.3.3 package, and use the osCommerce installer that's included. Once you have that working, import your database using your host's Admin tool (usually phpMyAdmin.)

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Of course I can get the same error. The table is recreated when I run "reload".

 

The error was that the old topics_id was auto_increment starting at 0. The new database refused that, wanting to start at 1. I had to remove all insert under topics and articles and then it worked.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...