MyBB Community Forums

Full Version: Help someone please! Need phpmyadmin code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I want to execute a query via phpmyadmin that takes users in a certain usergroup which havent been online in __ amount of days and moves them to another usergroup/default usergroup.
can someone help?
UPDATE mybb_users SET usergroup='newgroup' WHERE usergroup = 'oldgroup' AND lastvisit < unixTimestampOfTheCutoff

So for example

UPDATE mybb_users SET usergroup='9' WHERE usergroup = '8' AND lastvisit < 1392285284

Will move all people in usergroup 8 who haven't visited since Thu, 13 Feb 2014 09:54:44 GMT to usergroup 9.

Find the timestamp you want here: http://www.epochconverter.com/