Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help please problem in completing orders


ctmiller2

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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;

Archived

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

×
×
  • Create New...