Jump to content
Sign in to follow this  
Nala

#1062 - Duplicate entry '400' for key 1

Recommended Posts

Hi everbody,

 

The story

I am getting above error on trying to run the SQL-script on installing a new contribution.

The error occured the first time on running the newest script of "shadow controller". After searching the forum I tried the older script of "shadow controller" and had no problems.

Then I tried to install "column controller" and was delighted to see same error again.

 

The general fact

- osCommerce Online Merchant v2.2 RC1 release.

- new database and imported customer and product tables from the old database

- both errors relate to configuration_group and/or the 400

 

 

Facts on shadowe controller

When running shadow_controller.sql first error says:

SQL-Befehl:

 

INSERT INTO configuration_group

VALUES ( 400, 'Shadow Controller', 'Shadow Controller - configuration options', 19, 1 ) ;

 

MySQL meldet: Dokumentation

#1062 - Duplicate entry '400' for key 1

 

clicking on the button to show, it says:

SQL-Befehl: Dokumentation

 

SELECT *

FROM Array

WHERE CONCAT_WS( "-", 400, 'Shadow Controller', 'Shadow Controller - configuration options', 19, 1 ) = "400"

ORDER BY 400 , 'Shadow Controller', 'Shadow Controller - configuration options', 19, 1

LIMIT 0 , 30

 

MySQL meldet: Dokumentation

#1146 - Table 'usr_web101_4.Array' doesn't exist

 

 

the code of the working shadow_controller.sql:

DELETE from configuration_group WHERE configuration_group_title="Shawdow Controller";

INSERT INTO configuration_group VALUES ('', 'Shadow Controller', 'Shadow Controller - configuration options', 1, 1);

UPDATE configuration_group SET sort_order=last_insert_id() WHERE configuration_group_id=last_insert_id();


INSERT INTO configuration  VALUES  ('', 'Show Shadows', 'SHOW_SHADOWS', 'true', 'Enable Shadow Controller<br><br>true= on<br>false= off', last_insert_id(), 10, NULL, '2004-08-14 00:25:08', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')
,('', 'Shadow Folder', 'SHADOW_FOLDER', '/shadow_controller/shadow_right_broad/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Side', 'SHADOW_SIDE', 'right_bottom', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br> bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Height', 'SHADOW_HEIGHT', '12', '', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Width', 'SHADOW_WIDTH', '14', '', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Folder (ALT 1 )', 'SHADOW_FOLDER_ALT_1', '/shadow_controller/shadow_left/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Side (ALT 1 )', 'SHADOW_SIDE_ALT_1', 'left', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br> bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Height (ALT 1 )', 'SHADOW_HEIGHT_ALT_1', '11', '', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Width (ALT 1 )', 'SHADOW_WIDTH_ALT_1', '15', '', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Folder (ALT 2 )', 'SHADOW_FOLDER_ALT_2', '/shadow_controller/shadow_right_broad/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Side (ALT 2 )', 'SHADOW_SIDE_ALT_2', 'bottom', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br>  bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Height (ALT 2 )', 'SHADOW_HEIGHT_ALT_2', '12', '', last_insert_id(),  45, now(), now(), NULL, NULL)
, ('', 'Shadow Width (ALT 2 )', 'SHADOW_WIDTH_ALT_2', '14', '', last_insert_id(),  45, now(), now(), NULL, NULL);

 

 

The code of the unloved shadow_controller.sql:

DELETE from configuration_group WHERE configuration_group_title="Shawdow Controller";

INSERT INTO configuration_group VALUES (400, 'Shadow Controller', 'Shadow Controller - configuration options', 19, 1);

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show Shadows', 'SHOW_SHADOWS', 'true', 'Enable Shadow Controller<br><br>true= on<br>false= off', 400, 10, NULL, '2004-08-14 00:25:08', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Folder', 'SHADOW_FOLDER', '/shadow_controller/shadow_right_broad/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', 400,  11, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Side', 'SHADOW_SIDE', 'right_bottom', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br> bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', 400, 12, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Height', 'SHADOW_HEIGHT', '12', '', 400, 13, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Width', 'SHADOW_WIDTH', '14', '', 400, 14, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Folder (ALT 1 )', 'SHADOW_FOLDER_ALT_1', '/shadow_controller/shadow_left/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', 400, 15, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Side (ALT 1 )', 'SHADOW_SIDE_ALT_1', 'left', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br> bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', 400, 16, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Height (ALT 1 )', 'SHADOW_HEIGHT_ALT_1', '11', '', 400, 17, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Width (ALT 1 )', 'SHADOW_WIDTH_ALT_1', '15', '', 400, 18, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Folder (ALT 2 )', 'SHADOW_FOLDER_ALT_2', '/shadow_controller/shadow_right_broad/', 'Enter path to the files for this shadow affect.  Note that the path must end in a slash ( / ).<br>', 400, 19, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Side (ALT 2 )', 'SHADOW_SIDE_ALT_2', 'bottom', 'Choose one of the following.  Note that this entry must coincide with the folder selected in Shadow Folder.<br><br>  bottom<br>left<br>left_bottom<br>right<br>right_bottom<br>full<br>', 400, 20, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Height (ALT 2 )', 'SHADOW_HEIGHT_ALT_2', '12', '', 400, 20, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Shadow Width (ALT 2 )', 'SHADOW_WIDTH_ALT_2', '14', '', 400, 21, now(), now(), NULL, NULL);

 

 

Facts on "column controller"

 

first error says:

SQL-Befehl:

 

-- phpMyAdmin SQL Dump

-- version 2.6.0-beta2

-- http://www.phpmyadmin.net

--

-- Host: localhost

-- Generation Time: Jul 28, 2004 at 09:08 PM

-- Server version: 3.23.58

-- PHP Version: 4.3.6

--

-- Database: `catalog`

--

-- --------------------------------------------------------

--

-- Dumping data for table `configuration_group`

--

INSERT INTO `configuration_group` ( `configuration_group_id` , `configuration_group_title` , `configuration_group_description` , `sort_order` , `visible` )

VALUES ( 400, 'Column Controller', 'Configure Column width which boxes will display and where.', '', 0 ) ;

 

MySQL meldet: Dokumentation

#1062 - Duplicate entry '400' for key 1

 

clicking on button to show I get:

column.jpg

 

 

 

Now I need help from people to whom the exact cause of the error is more obvious than it is to me :-)

 

 

 

Thanks for your help

Nala


Leben und leben lassen - live and let live - vivrer et laisser vivre

Share this post


Link to post
Share on other sites
INSERT INTO configuration_group VALUES (400, 'Shadow Controller', 'Shadow Controller - configuration options', 19, 1);

 

first error says:

#1062 - Duplicate entry '400' for key 1

The above means there is already an entry in the database with an id of 400. You can look in the configuration_group table to find an available id and change the above statement to that, or just try some other number, like 500.The statements that change the configuration table will also need that number changed.

 

Jack

Share this post


Link to post
Share on other sites
The above means there is already an entry in the database with an id of 400. You can look in the configuration_group table to find an available id and change the above statement to that, or just try some other number, like 500.The statements that change the configuration table will also need that number changed.

 

Jack

 

Thanks Jack,

 

or perhaps not "thanks Jack" ? ;-)

 

Your answer helped me to see that for some reason all or many tables from the old database are also in the new database though I haven't got a clue how this could pssibly have happened...

 

I do not want all the old crap in my new database, so how to go about this best ?

 

If I was sure I knew what I am doing, I would create a new database again, run oscommerce.sql and try again importing the tables for products and customers.

Afterwards I would change the database name in configure.php and admin/configure.php.

 

 

What would you do ?

 

 

Thanks

Nala


Leben und leben lassen - live and let live - vivrer et laisser vivre

Share this post


Link to post
Share on other sites

You can do the following but realize that all data will be lost:

 

Go into phpmyadmin and backup the database.

Select all of the tables and select Drop from the dropdown menu. That will remove all the tables.

Click on Import and load in the new database.

 

Jack

Share this post


Link to post
Share on other sites
You can do the following but realize that all data will be lost:

 

Go into phpmyadmin and backup the database.

Select all of the tables and select Drop from the dropdown menu. That will remove all the tables.

Click on Import and load in the new database.

 

Jack

 

 

Now a real, true thanks to you. It was a hard fight between the database and me but we finally agreed to a compromise and I have learned a bit more ;-)


Leben und leben lassen - live and let live - vivrer et laisser vivre

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×