Quote:
Originally Posted by MagicPID
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.