Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Duplicate entry problem


digicammad

Recommended Posts

I am in the process of setting up a shop and, until today, it was working fine. All of a sudden I am now getting the following error when I try to add a product to the shopping cart:

 

1062 - Duplicate entry '0' for key 1

 

insert into customers_basket (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('2', '2', '1', '20060217')

 

When I return to the shop the cart shows the product in there.

 

I have obviously screwed something up somewhere but have no idea where. Can anybody point me in the right direction please?

 

Thanks

Link to comment
Share on other sites

I am in the process of setting up a shop and, until today, it was working fine. All of a sudden I am now getting the following error when I try to add a product to the shopping cart:

 

1062 - Duplicate entry '0' for key 1

 

insert into customers_basket (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('2', '2', '1', '20060217')

 

When I return to the shop the cart shows the product in there.

 

I have obviously screwed something up somewhere but have no idea where. Can anybody point me in the right direction please?

 

Thanks

 

 

Hope you find a solution, and if you do, please post, I am getting the same error, only it happens when I click on "confirm order" (was testing the store today). The table of course is another one, it's orders.

 

Elaine

"There are only 10 types of people in this world: those who understand binary, and those who don't. "

Link to comment
Share on other sites

I've just found and fixed it.

 

I populated the online db by backing up my local db and restoring it online. It seems that for some reason this process turned off all the auto sequences on the schema. The fix was to use MySQLAdmin to view both local and online dbs and turn on the auto sequence on all tables which needed it according to the local version.

 

It is now working fine, but if somebody would care to tell me why that happened I would be most grateful.

 

I hope this solves your problem Elaine.

 

Ian

Link to comment
Share on other sites

I've just found and fixed it.

 

I populated the online db by backing up my local db and restoring it online. It seems that for some reason this process turned off all the auto sequences on the schema. The fix was to use MySQLAdmin to view both local and online dbs and turn on the auto sequence on all tables which needed it according to the local version.

 

It is now working fine, but if somebody would care to tell me why that happened I would be most grateful.

 

I hope this solves your problem Elaine.

 

Ian

 

 

I don't have anything stored locally

 

:(

 

Elaine :(

"There are only 10 types of people in this world: those who understand binary, and those who don't. "

Link to comment
Share on other sites

I've just found and fixed it.

 

I populated the online db by backing up my local db and restoring it online. It seems that for some reason this process turned off all the auto sequences on the schema. The fix was to use MySQLAdmin to view both local and online dbs and turn on the auto sequence on all tables which needed it according to the local version.

 

It is now working fine, but if somebody would care to tell me why that happened I would be most grateful.

 

I hope this solves your problem Elaine.

 

Ian

 

 

Problem fixed. Someone told me to change the order id field in the orders table to auto-increment. That did it (thanks to Emmet!).

 

Elaine

"There are only 10 types of people in this world: those who understand binary, and those who don't. "

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...