UBB.Dev
Posted By: coloradok5 Need sql command - 07/11/2002 7:27 AM
I have about 500 people in the "users" group that are also in the "members" group, how do I make them to be just in the "members" group? Just need to drop anyone that is a member from the user group.
Posted By: navaho Re: Need sql command - 07/11/2002 9:22 AM
Ok, first lets get your group numbers:

SELECT * FROM w3t_Groups

For my board it is:

code:

G_Name G_Id
Administrators 1
Moderators 2
Users 3
Guests 4



Yours may vary, so for the sake of this demo we'll say your "Member" group is G_Id 5 and your "Users" G_Id is 3.

UPDATE w3t_Users SET U_Groups = '-5-' WHERE U_Groups = '-3-5-'

That should do it. Be sure to make a backup of the db first. Always make a backup before doing anything else if you're tinkering directly with the database.

Remember to check those group numbers first!
Posted By: Dave_L_dup1 Re: Need sql command - 07/11/2002 1:16 PM
I've noticed that the group numbers are not always in numerical order, i.e., w3t_Users.U_Groups might be '-5-3-'.

A better query might be:
UPDATE w3t_Users SET U_Groups='-5-' WHERE U_Groups='-3-5-' OR U_Groups='-5-3-'
Posted By: coloradok5 Re: Need sql command - 07/11/2002 4:13 PM
Thank's guys, worked like a charm, it didn't do the moderator's that were in this situation but I only have a handfull and just did them by hand.
© UBB.Developers