MyBB Community Forums

Full Version: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This is an easy SQL Query that you can run in phpMyAdmin

DELETE FROM mybb_users where postnum = '0' and lastvisit < '1229691992';

This query delete users from database with last visit in Dec.14 2008 or later and 0 posts...

Use this form to your needs: http://www.unixtimestamp.com/index.php



...
Nice Tutorial thanks great man
can u provide for me command for last active..one year..
Run this;
DELETE FROM mybb_users where postnum = '0' and lastvisit < '2459383984'; 
Nice tutorials, thanks
you can use UNIX_TIMESTAMP() to convert the date for you, assuming you are using MySQL or another RDBMS that supports that function.

DELETE FROM mybb_users where postnum = '0' and lastvisit < UNIX_TIMESTAMP('2010-10-30 00:00:00')
This tutorial is redundant for MyBB 1.6 as the new version supports User Pruning.
(2011-04-10, 11:02 AM)Shukaku Wrote: [ -> ]This tutorial is redundant for MyBB 1.6 as the new version supports User Pruning.

So you had to go and find it just to state it?

Some people, such as myself, prefer queries then backend edits.
(2011-04-10, 06:19 PM)Aristotle Wrote: [ -> ]
(2011-04-10, 11:02 AM)Shukaku Wrote: [ -> ]This tutorial is redundant for MyBB 1.6 as the new version supports User Pruning.
Some people, such as myself, prefer queries then backend edits.

>>as the new version supports User Pruning.

wat
(2011-04-10, 06:19 PM)Aristotle Wrote: [ -> ]So you had to go and find it just to state it?
No, someone bumped this 2 year old thread, that's why I stated it...

@Scoutie: Yep. Toungue
Pages: 1 2