MyBB Community Forums

Full Version: Need SQL help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, My forum exploded literally over night (as in 300 online user in 1 minute) and 100s of registrations. I know my way a bit around in PHP, but am a total SQL noob.

Usually i move new members from Group A to Group B manually after they made 1 post.

This would take me hours to do it by hand, so i need a SQL query that
moves members with at least 1 post AND have registered since yesterday from group A to Group B

Can anyone help me?
UPDATE `mybb_users` SET `usergroup` = 'B' WHERE `usergroup` = 'A' AND `postnum` >= '1' AND `regdate` > '1296906752';

This'll move people who registered in the last 24 hours. Change the A and B to the IDs of the relevant usergroups.

Also it'd probably be a lot easier to use the promotions system to change their usergroups, rather than doing it manually...
(2011-02-06, 11:54 AM)MattRogowski Wrote: [ -> ]
UPDATE `mybb_users` SET `usergroup` = 'B' WHERE `usergroup` = 'A' AND `postnum` >= '1' AND `regdate` > '1296906752';

This'll move people who registered in the last 24 hours. Change the A and B to the IDs of the relevant usergroups.

Also it'd probably be a lot easier to use the promotions system to change their usergroups, rather than doing it manually...


That worked like a charm!

That would indeed be easier, but the usergroup goes with imageposting privileges.. There needs to be at least 1 moderator on if you allow that..

Thanks!