MyBB Community Forums

Full Version: Help with sql query
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm trying to get rid of the spam users with 0 posts.
The easiest way would be to run a sql query.

Will this work sql query do what I described above?:

computing_tech_ is the database name
DELETE * FROM computing_tech_ 
WHERE mybb_posts = 0
The correct SQL query would be:

DELETE FROM `mybb_users` WHERE `postnum` = '0'

But you can easily prune users by going to Admin CP > Configuration > Settings > User Pruning and play with the options.
So user pruning is in fact used to delete users?
Yes. You can also delete the user's threads and posts by enabling the last option.
I turned on user pruning now, I set the number of days to 0 yet the members are still there.

Guess I'll go with the sql query you provided.
By default, users are pruned every 2 hours. If you'd like to prune them on a specific moment, go to Admin CP > Tools & Maintenance > Task Manager. In the row that corresponds to User Pruning, click the alarm icon.
That's all then, this is solved.