vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   SQL Query to change email notifications and change user group (https://vborg.vbsupport.ru/showthread.php?t=325521)

Spika 08-18-2017 06:21 AM

SQL Query to change email notifications and change user group
 
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

1 Attachment(s)
Quote:

Originally Posted by Stingray27 (Post 2589437)
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:

Attachment 156619


All times are GMT. The time now is 08:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02810 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete