ctmiller2 Posted November 8, 2003 Posted November 8, 2003 Hi I am recieving the following error when trying to complete an order. Any help is greatly appreciated 1062 - Duplicate entry '1' for key 1 insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('4', '1', now(), '1', '') [TEP STOP] ted miller
ctmiller2 Posted November 8, 2003 Author Posted November 8, 2003 This error occurs when completing an order. If I delete all of my test orders and start from scratch the first order will complete ok.
Guest Posted November 8, 2003 Posted November 8, 2003 In phpMyAdmin, try running insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('4', '2', now(), '1', ''); twice and see if it comes up with an error either time. Please post the error if you get one. It seems to me that either orders_status_id or customer_notified has gotten set to be unique. You would want to change this behavior so that it can have the same value in multiple places. Hth, Matt
ctmiller Posted November 9, 2003 Posted November 9, 2003 #1062 - Duplicate entry '2' for key 1 This is what I get when I run the query the second time.
Guest Posted November 10, 2003 Posted November 10, 2003 From phpMyAdmin, can you export the orders_status_history structure and copy the results to here? In the version I use, you would select the osCommerce database; click on the orders_status_history (from the menu on the left); click Export (tabs on top); structure should be checked and data should be unchecked; click go; then copy and paste the results to here. They would look something like CREATE TABLE `orders_status_history` ( `orders_status_history_id` int(11) NOT NULL auto_increment, `orders_id` int(11) NOT NULL default '0', `orders_status_id` int(5) NOT NULL default '0', `date_added` datetime NOT NULL default '0000-00-00 00:00:00', `customer_notified` int(1) default '0', `comments` text, PRIMARY KEY (`orders_status_history_id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ; Hth, Matt
ctmiller Posted November 11, 2003 Posted November 11, 2003 Here you go with the dump. I took out the index on order status history and can complete orders but not confident that what I did is correct. But it at least lets orders complete. # phpMyAdmin SQL Dump # version 2.5.4-rc2 # http://www.phpmyadmin.net # # Host: localhost # Generation Time: Nov 10, 2003 at 09:45 PM # Server version: 3.23.56 # PHP Version: 4.3.3 # # Database : `jdavida_shop` # # -------------------------------------------------------- # # Table structure for table `orders_status_history` # CREATE TABLE `orders_status_history` ( `orders_status_id` int(5) NOT NULL default '0', `orders_id` int(5) NOT NULL default '0', `new_value` int(5) NOT NULL default '0', `old_value` int(5) default NULL, `date_added` datetime NOT NULL default '0000-00-00 00:00:00', `customer_notified` int(1) default '0', `comments` text NOT NULL ) TYPE=MyISAM;
Recommended Posts
Archived
This topic is now archived and is closed to further replies.