Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Grrrrr accidentally ran an sql file twice now I have dupes...


jacenstuff

Recommended Posts

How do I reverse what I did? If I ran a file such as this:

 

INSERT INTO `configuration`

(`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`)

VALUES

('', 'USPS Return Name', 'USPS_RETURN_NAME', '', 'Enter the name you want on shipping labels etc.', 7, 10, NULL, now(), NULL, NULL),

('', 'USPS Return Company', 'USPS_RETURN_COMPANY', '', 'Enter the Company you want on shipping labels etc.', 7, 11, NULL, now(), NULL, NULL),

('', 'USPS Return Street', 'USPS_RETURN_STREET', '', 'Enter the street address you want on shipping labels.', 7, 12, NULL, now(), NULL, NULL),

('', 'USPS Return Street 2', 'USPS_RETURN_STREET2', '', 'Enter the 2nd line of the street address you want on shipping labels.', 7, 13, NULL, now(), NULL, NULL),

('', 'USPS Return City', 'USPS_RETURN_CITY', '', 'Enter the city you want on shipping labels etc.', 7, 14, NULL, now(), NULL, NULL),

('', 'USPS Return State', 'USPS_RETURN_STATE', '', 'Enter the two letter state code you want on shipping labels.', 7, 15, NULL, now(), NULL, NULL),

('', 'USPS Return Zip', 'USPS_RETURN_ZIP', '', 'Enter the zip code you want on shipping labels.', 7, 16, NULL, now(), NULL, NULL),

('', 'USPS Ship To Address', 'USPS_SHIP_ADDRESS', 'Shipping', 'Use the shipping or billing address to ship to.', 7, 17, NULL, now(), NULL, "tep_cfg_select_option(array('Shipping', 'Billing'),"),

('', 'USPS Weight Override', 'USPS_WEIGHT_OVERRIDE', '', 'To override automatic weights, enter the weight in pounds that you want all packages to be. Set to blank to calculate weight. Set to 0 and all weights will have to be entered.', 7, 18, NULL, now(), NULL, NULL),

('', 'USPS Send Value Over', 'USPS_SEND_VALUE_OVER', '0', 'When to send contents value so that insurance can be purchased - Set to 0 to send values for all, or a very large number for never.', 7, 19, NULL, now(), NULL, NULL),

('', 'USPS Shipping Cutoff Hour', 'USPS_CUTOFF_HOUR', '17', 'Cutoff time for shipments in 24 hour format. Shipments done after this time will be defaulted to the next date. Note: Uses your server time.', 7, 20, NULL, now(), NULL, NULL),

('', 'USPS Ship From Zip', 'USPS_SHIP_FROM_ZIP', '', 'Enter the zip code you will be shipping from. Leave blank if it is the same as the return zip code.', 7, 21, NULL, now(), NULL, NULL),

('', 'USPS Phone Number', 'USPS_PHONE', '', 'Enter your phone number that is required for international shipments, no dashes (XXXXXXXXXX).', 7, 22, NULL, now(), NULL, NULL),

('', 'USPS Email', 'USPS_EMAIL', 'NO', 'Send customers email address?', 7, 23, NULL, now(), NULL, "tep_cfg_select_option(array('YES', 'NO'),");

 

 

How do I remove what I have done? I searched around the web and tried Alter drop and all them other things... i'm afraid of messing up my junk, now I have dual listings in my admin section and it hurts my eyes like mad. I know some sql guru out there knows what I should do. please help... pretty please.

We must be the change we wish to see in the world.

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

p.s. BACKUP!

Link to comment
Share on other sites

How do I reverse what I did? If I ran a file such as this:

 

INSERT INTO `configuration`

(`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`)

VALUES

('', 'USPS Return Name', 'USPS_RETURN_NAME', '', 'Enter the name you want on shipping labels etc.', 7, 10, NULL, now(), NULL, NULL),

('', 'USPS Return Company', 'USPS_RETURN_COMPANY', '', 'Enter the Company you want on shipping labels etc.', 7, 11, NULL, now(), NULL, NULL),

('', 'USPS Return Street', 'USPS_RETURN_STREET', '', 'Enter the street address you want on shipping labels.', 7, 12, NULL, now(), NULL, NULL),

('', 'USPS Return Street 2', 'USPS_RETURN_STREET2', '', 'Enter the 2nd line of the street address you want on shipping labels.', 7, 13, NULL, now(), NULL, NULL),

('', 'USPS Return City', 'USPS_RETURN_CITY', '', 'Enter the city you want on shipping labels etc.', 7, 14, NULL, now(), NULL, NULL),

('', 'USPS Return State', 'USPS_RETURN_STATE', '', 'Enter the two letter state code you want on shipping labels.', 7, 15, NULL, now(), NULL, NULL),

('', 'USPS Return Zip', 'USPS_RETURN_ZIP', '', 'Enter the zip code you want on shipping labels.', 7, 16, NULL, now(), NULL, NULL),

('', 'USPS Ship To Address', 'USPS_SHIP_ADDRESS', 'Shipping', 'Use the shipping or billing address to ship to.', 7, 17, NULL, now(), NULL, "tep_cfg_select_option(array('Shipping', 'Billing'),"),

('', 'USPS Weight Override', 'USPS_WEIGHT_OVERRIDE', '', 'To override automatic weights, enter the weight in pounds that you want all packages to be. Set to blank to calculate weight. Set to 0 and all weights will have to be entered.', 7, 18, NULL, now(), NULL, NULL),

('', 'USPS Send Value Over', 'USPS_SEND_VALUE_OVER', '0', 'When to send contents value so that insurance can be purchased - Set to 0 to send values for all, or a very large number for never.', 7, 19, NULL, now(), NULL, NULL),

('', 'USPS Shipping Cutoff Hour', 'USPS_CUTOFF_HOUR', '17', 'Cutoff time for shipments in 24 hour format. Shipments done after this time will be defaulted to the next date. Note: Uses your server time.', 7, 20, NULL, now(), NULL, NULL),

('', 'USPS Ship From Zip', 'USPS_SHIP_FROM_ZIP', '', 'Enter the zip code you will be shipping from. Leave blank if it is the same as the return zip code.', 7, 21, NULL, now(), NULL, NULL),

('', 'USPS Phone Number', 'USPS_PHONE', '', 'Enter your phone number that is required for international shipments, no dashes (XXXXXXXXXX).', 7, 22, NULL, now(), NULL, NULL),

('', 'USPS Email', 'USPS_EMAIL', 'NO', 'Send customers email address?', 7, 23, NULL, now(), NULL, "tep_cfg_select_option(array('YES', 'NO'),");

How do I remove what I have done? I searched around the web and tried Alter drop and all them other things... i'm afraid of messing up my junk, now I have dual listings in my admin section and it hurts my eyes like mad. I know some sql guru out there knows what I should do. please help... pretty please.

 

Lots of ways to do it. The easiest way for me? Just going into phpMyAdmin tools (if you are unsure, ask your hosting company where it is), then go into the configuration table, locate the duplicate entries and delete them out. Problem solved.

 

Other ways? You could export the entire configurations table with a DROP statement, manually remove the dups, and reupload to overwrite....but if you are capable of all that....then you could do the first one and save some time..lol.

 

If you don't know how to do it and cannot figure it out using phpMyAdmin...especially if you have never used those tools....you are better off hiring an oscommerce programmer to do a quick fix for you for like 5 minutes worth of work than to risk messing up your database.

 

Hope this helps.

Sincerely,

Bruce

 

19 contributions submitted

Link to comment
Share on other sites

Oh, I should've mentioned this: I don't use or have access to phpMyAdmin tools, long story short, I just do NOT have access, so I have to do it by hand. my issue is having ahard time locating the dupes... don't really know the commands to well, I can only go off a handful of commands I find online. Sometimes when I do my search I'm not even sure how to phrase the question so my jargon will return decent results of commands for mysql. I get stuff like "how to delete a column, table, etc." and i'm like..."the stuff I jsut entered...are they rows, columns, tables, what?" also what properties do they have? so... I customized one set of the commands ran from the file, so my question is.. to get rid of the duplicate ones, they wouldn't have any information in them, so is there a seek and destroy items with no information in them button? can't I just mod the top line of the command to remove instead of install? I can run the code myself, i jsut need to know what the code is. So your information is very helpfula nd very appreciated...I do like your export idea though... how do i do that?

We must be the change we wish to see in the world.

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

p.s. BACKUP!

Link to comment
Share on other sites

I agree that phpMyAdmin would be the quickest fix for this. You say you don't have access but it is free software you can install just like oscommerce. get it here:

http://www.phpmyadmin.net/home_page/downloads.php

 

Besides this, to answer you, The sql you ran twice installed data into tables. the tables you want to keep the data you want to delete- the problem here is that there is not going to be much to identify the original row of data from the duplicate. You may be best off if you delete - say - all rows of data in the table 'configuration' then with an empty table put the data in fresh.

 

In your search the sql should be something like:

 

DELETE FROM configuration WHERE last_modified = '';

 

From the example given this will delete all data from table 'configuration'.

 

Make sure you know what and how to reinstall what you need before you do this.

 

If you have to use php to run the mysql you will have to add that to the sql query above.

Link to comment
Share on other sites

well...hmmm... is there a command I could use in Mysql that would delete any empty table in configuration? So i mean the tables that have data in them are obviously the ones being used, so to issue a command to remove any table that has no data in it would be the mose sufficient means of fixing this, i think. I would do a restore backup thing... although my dumbass screwed up and in short, it's too late for that. :( thanks for all the advice though guys, i've been getting different POV's and ideas on how to fix this, i might just have to track down the guy that can get me access to the phpmyadmin thingimabob, to manually remove those emtpy tables. we'll see what happens.

We must be the change we wish to see in the world.

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

p.s. BACKUP!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...