![]() |
Quick MYSQL Pruning Question...
Is there a simple mySQL query I can run on a message board (3.0.1) which will trim all of the messages from a particular forum APART from the first post?
Shame there isn't something in the admin prune options, but has anyone got a mySQL solution? |
Let's say you want to delete from forum 18:
[sql] DELETE FROM post USING post,thread WHERE post.threadid = thread.threadid AND thread.forumid=18 AND post.postid != thread.firstpostid [/sql] This should do the trick - it will delete all posts in that forum, except the first post of each thread. WARNING: Although this query was tested, I don't guarantee anything, so be strongly advised to backup your data first! Furthermore you must rebuild threads afterwards, as otherwise you will see wrong figures in forumdisplay. |
All times are GMT. The time now is 12:55 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:
|