Totally Zenned
- Join Date:
- Jan 2009
- Posts:
- 2,085
- Plugin Contributions:
- 0
Database Errors - Duplicate Entries - How Did You Hear About Us Mod
When I have "How did you hear about us" mod installed, I get this wierd error when I create a new account:
1062 Duplicate entry '765' for key 1
in:
[insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('765', '0', now(), '1')]
I ran the SQL patch that came with the mod, I ran it via "phpMyAdmin" and it gave an error as soon as I did, it said:
**Error
SQL query:
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
MySQL said: Documentation
#1060 - Duplicate column name 'customers_info_source_id' **
Here is the SQL patch that I applied:
DROP TABLE IF EXISTS sources;
CREATE TABLE sources (
sources_id int NOT NULL auto_increment,
sources_name varchar(64) NOT NULL,
PRIMARY KEY (sources_id),
KEY IDX_SOURCES_NAME (sources_name)
);
INSERT INTO sources VALUES (1, 'Google');
INSERT INTO sources VALUES (2, 'Yahoo!');
INSERT INTO sources VALUES (3, 'AOL');
INSERT INTO sources VALUES (4, 'MSN');
INSERT INTO sources VALUES (5, 'ZenCart');
DROP TABLE IF EXISTS sources_other;
CREATE TABLE sources_other (
customers_id int NOT NULL default '0',
sources_other_name varchar(64) NOT NULL,
PRIMARY KEY (customers_id)
);
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Referral', 'REFERRAL_REQUIRED', 'true', 'Require the Referral Source in account creation', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
So, could anyone please be so kind as to tell me how to reverse this SQL patch? More to the point, why after running the patch do I get the 1062 Duplicate entry '765' for key 1 error?