Mort-lemur Posted April 25, 2018 Share Posted April 25, 2018 Hi, Im looking to run a simple sql command to set all values in a database column to 0. To be more specific Im looking to unsubscribe all registered customers from the newsletter so table would be "Customers" and column would be "customers_newsletter" - I have googled solutions but there seems to be a couple of methods - and as always, with running sql commands the scope for disaster is huge - so I would be grateful if someone could give some expert advice please :) I know there is a large thread running on GDPR so I dont want to cloud that thread. Many Thanks Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
AngusD Posted April 25, 2018 Share Posted April 25, 2018 Hi, in phpMySQL it would be: update customers set customers_newsletter = '0' where 1; This would set all customers_newsletters columns to 0 in the customers table. Before you do this, backup your database and the do a backup of the backup. AD Edit: This is the easiest method and should work even on large databases. Link to comment Share on other sites More sharing options...
Mort-lemur Posted April 25, 2018 Author Share Posted April 25, 2018 Thank You :) Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.