![]() |
sql query to remove all posts and replies
sql query to remove all posts and replies of a member?
Its not possible via web interface because it is timing out. Number of posts to be removed are 100k+ |
Code:
DELETE FROM " . TABLE_PREFIX ."posts WHERE userid = YOUR_USER If running from phpMyAdmin or such, change " . TABLE_PREFIX ." to the actual table prefix |
Which should I rebuild after executing this?
The threads are still showing in forumdisplay and says invalid thread specified when clicked |
Post counts and search index
|
Quote:
|
Have you tried "Rebuild Thread Information" and "Rebuild Forum Information"?
|
Quote:
You have other suggestion Dave? |
Wait so you executed the following query right?
HTML Code:
DELETE FROM posts WHERE userid = YOUR_USER You also have to execute a query such as: HTML Code:
DELETE FROM thread WHERE postuserid = USERID_OF_USER |
Quote:
Thanks for your great help Dave! As well as Dragonsys for always helping the vb community :up: |
Quote:
|
And since the thread likely had posts not by the user you're removing deleting posts for you now have orphaned posts (i.e. posts not attached to an existing thread).
To delete them run the following: Code:
DELETE FROM post WHERE NOT threadid IN (SELECT threadid FROM thread) |
Great! Thanks for the addition squidsk!
Im sure this thread will also help other forum owners who deletes thousands of spams in one go. |
All times are GMT. The time now is 04:57 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|