PDA

View Full Version : help with a query


Staxed
04-14-2007, 02:24 PM
Well...I have many strong points...

mysql queries and coding are not one of them (yet)

I need help making a query that I can run...

What I'm trying to do is take all the users in my forum that have an email address whatever@specificdomain.com and move them to a certain usergroup

can anyone help me out with this :)

calorie
04-14-2007, 03:31 PM
Untested, so backup...

# replace vb3_ with your vB table prefix
# replace X with the new usergroup id
# replace @domain.com with the email

UPDATE vb3_user
SET displaygroupid = IF(displaygroupid = usergroupid, 0, displaygroupid),
usergroupid = X
WHERE email LIKE '%@domain.com';

Staxed
04-14-2007, 06:24 PM
worked perfectly, thanks :D