MyBB Community Forums
[HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts (/thread-49925.html)

Pages: 1 2


[HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - aglioeolio - 2009-05-15

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



...


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - *~Kamran Saleem~* - 2009-05-17

Nice Tutorial thanks great man


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - jameel225 - 2011-04-01

can u provide for me command for last active..one year..


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Yaldaram - 2011-04-01

Run this;
DELETE FROM mybb_users where postnum = '0' and lastvisit < '2459383984'; 



RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - themem - 2011-04-03

Nice tutorials, thanks


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - pavemen - 2011-04-03

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')



RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Sajuuk - 2011-04-10

This tutorial is redundant for MyBB 1.6 as the new version supports User Pruning.


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Lo. - 2011-04-10

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


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Scoutie44 - 2011-04-11

(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


RE: [HOW-TO] 1 line mySQL QUERY to delete users inactive 6 months with 0 posts - Sajuuk - 2011-04-11

(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