PDA

View Full Version : SQL Query to change email notifications and change user group


Spika
08-18-2017, 06:21 AM
Hello
I have VB 4.2.5 and a thousands of users that don´t have updated the email and I am receiving constantly email errors from theses older accounts. I wan to select all accounts with "terra.es" domain (in Spain Terra is KO) and send it to a new user-group called "bad_mail" and after disable mass email notifications when the user have received a new PM and when is their birthday...

NOTE: 34 -> Is "Bad_Mail", my new primary user-group

I have found these in Internet but I don´t know If can work...

SELECT vb_user WHERE email LIKE '%@terra.es%'
UPDATE vb_user SET usergroupid = 34 WHERE (email LIKE ‘%@terra.es’)

SELECT * FROM `user` WHERE `usergroupid` = 34
UPDATE vb_user SET options = options - 4096 WHERE options & 4096

Is Correct ? (lines, sintaxis..) etc

Thanks!
Regards
Rafa

Stingray27
08-18-2017, 11:57 PM
The selects are redundant if you just want to update.

No idea if 4096 is the right value, where did you get it from ?

Spika
08-19-2017, 05:51 AM
The selects are redundant if you just want to update.

No idea if 4096 is the right value, where did you get it from ?

Thanks for your reply

The 4096 is from Admin Panel when you select Automatic Query as this:

156619