MyBB Community Forums
Need SQL help - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Need SQL help (/thread-87873.html)



Need SQL help - Disturbed - 2011-02-06

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?


RE: Need SQL help - Matt - 2011-02-06

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...


RE: Need SQL help - Disturbed - 2011-02-06

(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!