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 move banned users? (https://vborg.vbsupport.ru/showthread.php?t=281576)

MagicPID 04-15-2012 03:34 AM

SQL Query to move banned users?
 
I need an SQL Query that will move all banned users that were just moved to the usergroup Banned and do not have an actual ban reason.

Is this possible?

Thanks

borbole 04-15-2012 11:04 AM

Quote:

Originally Posted by MagicPID (Post 2320228)
I need an SQL Query that will move all banned users that were just moved to the usergroup Banned and do not have an actual ban reason.

Is this possible?

Thanks

Do you want to move all users in the banned group who do not have a banned reason to another group?

Run this query:

Code:

UPDATE vb_user
LEFT JOIN vb_userban
ON
(vb_userban.userid = vb_user.userid)
SET vb_user.usergroupid = x WHERE vb_user.usergroupid = 8
AND vb_userban.reason = '';

Replace the x with the id of the group where you would like to move the banned members who do not have a banned reason and replace the vb_ prefix with whatever prefix that you use for your database tables.

Also make a backup of the user and userban tables as well before you run the query.

MagicPID 08-15-2012 04:04 AM

I just now got around to doing this and that query only does members that were actually banned using the banning system.

My issue is the users were just changed to the banned usergroup.


All times are GMT. The time now is 10:50 PM.

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.01583 seconds
  • Memory Usage 1,712KB
  • 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_code_printable
  • (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