Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deleting Data from Rows within a Table


TracyS

Recommended Posts

Does anyone have a fairly simple method for deleting the data within certain rows of a table without deleting the rows or the table? I have tried Truncate, but that takes everything out of all of the rows within the table, not just the rows I have selected (phpMyAdmin).

 

We moved our site, but want access to our stats from the old one, so I want to pull addresses and other private info out of the database, while still leaving the orders and such in tact for reports. So far, all I can see for doing this, is manually going through and deleting the info off of each record in the orders table. There has to be an easier way to delete the info in specific rows while leaving the rest of the table in-tact?? :blush:

 

Thanks in Advance!

~Tracy
 

Link to comment
Share on other sites

Yay- found a way! I used the following under the SQL tab in phpMyAdmin:

 

UPDATE `mmherbs_mmherbs`.`orders` SET `customers_street_address` = '', `customers_city` = '', `customers_postcode` = '', `customers_telephone` = '', `customers_email_address` = '', `delivery_street_address` = '', `delivery_city` = '', `delivery_postcode` = '', `billing_street_address` = '', `billing_city` = '', `billing_postcode` = '', `cc_type` = '', `cc_owner` = '', `cc_number` = '', `cc_expires` = '';

 

Does anyone have a fairly simple method for deleting the data within certain rows of a table without deleting the rows or the table? I have tried Truncate, but that takes everything out of all of the rows within the table, not just the rows I have selected (phpMyAdmin).

 

We moved our site, but want access to our stats from the old one, so I want to pull addresses and other private info out of the database, while still leaving the orders and such in tact for reports. So far, all I can see for doing this, is manually going through and deleting the info off of each record in the orders table. There has to be an easier way to delete the info in specific rows while leaving the rest of the table in-tact?? :blush:

 

Thanks in Advance!

~Tracy
 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...