TracyS Posted June 20, 2011 Share Posted June 20, 2011 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 More sharing options...
TracyS Posted June 20, 2011 Author Share Posted June 20, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.