Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Set Values in Database


Mort-lemur

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...