Guest Posted July 23, 2006 Posted July 23, 2006 Hi guys! I need some help badly. :( I just today deleted all the countries from the list as we won't ship to 99% of them, and they were annoying for customers to sort through and find the United States. Because there were so many and osCommerce's admin system wouldn't let me group delete, I did it through phpMyAdmin. Now there are 3 countries, but whenever somebody tries to make an account, after they fill in all the fields they get this error: 1062 - Duplicate entry '141' for key 1 insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('141', '0', now(), '7') [TEP STOP] How do I fix this? What caused this? You can try for yourself if you goto our website @ http://www.gnvmotorsports.com, add something to your cart, and try to check out. Thanks in advance.. Chris GNV Motorsports
Guest Posted July 23, 2006 Posted July 23, 2006 Now because of me testing it is trying to add customer_id 147 and above (if i keep going), but we only have 141 customers so far. How would I go about reseting the customer_id counter back to 141, and then fix this error?
jasonabc Posted July 23, 2006 Posted July 23, 2006 To restore the countries table - download a fresh copy of OSC, extract it and browse to the /catalog/install/ folder. Open the oscommerce.sql file and grab all the countries INSERT statements that begin around line 838. Use PhpMyAdmin to empty your countries table. Select the SQL tab and paste all those INSERT statements in. This will restore the countries table back to it's original form. Instead of deleteing countries from the countries table - you can just modify the dropdown instead. This is done from /catalog/includes/functions/html_output.php. To display all countries - but display United States as the first one in the list find this line: $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); and change to this: $countries_array = array(array('id' => '223', 'text' => 'United States')); To only display United States only in the dropdown (i.e. your dropdown consists of one country) find this line: $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); and replace with this: $countries_array = array(array('id' => '223', 'text' => 'United States')); Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
Guest Posted July 23, 2006 Posted July 23, 2006 Thanks for that, that helped get all the countries back in order. Also, for anyone with the same problem as me, the problem with creating the account was I didn't install our "RMH How did you Hear about us?" Contribution correctly, and it was trying to add the customer twice. It's fixed.
jasonabc Posted July 23, 2006 Posted July 23, 2006 p.s. make sure you EMPTY the countries table - not *DROP* (delete) it. Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 9, 2006 Posted August 9, 2006 Okay, I did a "stupid" and deleted the countries (except US) via admin. I do not have mySQL installed on my production pc. Would someone be able to email me the INSERT etc. that I can paste back into my countries table? Thanks "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 9, 2006 Posted August 9, 2006 download a fresh version of OSC. Extract it and surf to the oscommerce.sql file (in catalog/install). The INSERT statements for all the countries are in there ;-) Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 9, 2006 Posted August 9, 2006 Thanks Jason, however I don't have any way to open the .sql file on my production computer. I do not have mysql installed (yet). Any other way to get the needed information? Thanks "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 10, 2006 Posted August 10, 2006 you don't need MySQL to open a .sql file. Notepad will do the job just fine. Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 10, 2006 Posted August 10, 2006 Thanks, hate to be such a noob!!! "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 10, 2006 Posted August 10, 2006 No problem - we were all newbies at one time or another ;-)) Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 10, 2006 Posted August 10, 2006 Jason, Sorry, but I need a little handholding here as I have never worked phpMyAdmin either. I can find where to Empty (haven't emptied yet) the countries table, and I have looked at the Insert tab, but how do I insert all of the countries at once? "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 10, 2006 Posted August 10, 2006 I can find where to Empty (haven't emptied yet) the countries table, but how do I insert all of the countries at once? I don't understand your question. You say you haven't yet emptied the countries table - so how/why do you want to insert all of the countries at once to a table that already has all the countries inside it? Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 10, 2006 Posted August 10, 2006 Because I deleted all of the countries (except US) through the osCommerce Administration. "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 10, 2006 Posted August 10, 2006 Because I deleted all of the countries (except US) through the osCommerce Administration. You don't have access to the database through OSC Admin? You can only backup/restore the db - not access it's tables etc. Anyway - make sure the countries table is empty (just delete the single remaining country in there). To insert all the countries back into the table - grab all the country INSERT statements from that oscommerce.sql file. Open the countries table in PhpMyAdmin. Click the SQL tab at the top of PhpMyAdmin. Paste it in the box and click Go. Your countries table will have been restored to it's original state. Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 10, 2006 Posted August 10, 2006 I have access. I deleted the remaining country and pasted the countries in, received the following error Server: hrm-texas.org Database: osc_hrm_texas_org Table: countries Error SQL-query: SELECT * FROM `countries` WHERE 1 INSERT INTO countries VALUES ( 1, 'Afghanistan', 'AF', 'AFG', '1' ) MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO countries VALUES (1,'Afghanistan','AF','AFG','1')' An example of the code I pasted: INSERT INTO countries VALUES (1,'Afghanistan','AF','AFG','1'); INSERT INTO countries VALUES (2,'Albania','AL','ALB','1'); INSERT INTO countries VALUES (3,'Algeria','DZ','DZA','1'); INSERT INTO countries VALUES (4,'American Samoa','AS','ASM','1'); INSERT INTO countries VALUES (5,'Andorra','AD','AND','1'); INSERT INTO countries VALUES (6,'Angola','AO','AGO','1'); INSERT INTO countries VALUES (7,'Anguilla','AI','AIA','1'); INSERT INTO countries VALUES (8,'Antarctica','AQ','ATA','1'); However, I think the returns area hardcoded. Would that cause the problem? "If you obey all the rules, you miss all the fun." Katherine Hepburn
slanetx Posted August 10, 2006 Posted August 10, 2006 And when I try to go back, it tells me - Host name is empty "If you obey all the rules, you miss all the fun." Katherine Hepburn
jasonabc Posted August 10, 2006 Posted August 10, 2006 Your INSERT statements are fine. It is erroring here: SELECT * FROM `countries`WHERE 1 INSERT INTO countries VALUES ( 1, 'Afghanistan', 'AF', 'AFG', '1' ) Jason My Contributions: Paypal Payflow PRO | Rollover Category Images | Authorize.net Invoice Number Fix
slanetx Posted August 10, 2006 Posted August 10, 2006 I think I really messed up! When I go Home, here is what I get: The host name is empty! Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/main.php on line 21 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/main.php on line 23 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/ob.lib.php on line 61 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/header_http.inc.php on line 14 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/header_http.inc.php on line 15 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/header_http.inc.php on line 16 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/header_http.inc.php on line 17 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/common.lib.php:1258) in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/libraries/header_http.inc.php on line 20 Welcome to phpMyAdmin 2.6.0-pl2 Fatal error: Call to undefined function: pma_dbi_query() in /home/httpd/phpMyAdmin.2.6.0-pl2/phpMyAdmin/main.php on line 105 "If you obey all the rules, you miss all the fun." Katherine Hepburn
Recommended Posts
Archived
This topic is now archived and is closed to further replies.