Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: ryansdistrict - heinäkuu 04, 2008, 09:18:49 AP

Otsikko: what is the mysql query to remove topics& messages with less than x views
Kirjoitti: ryansdistrict - heinäkuu 04, 2008, 09:18:49 AP
Helllo
my site is getting out of control
i want to run a mysql query that will remove all topics which have less than x views and from specific forum id
for example i want to remove topics with less than 5 views in the news forum whose id is 5
i want to remove topics form the database from both topics and messages tables which are under the condition mentioned

What is the query that does this

Thank you
Otsikko: Re: what is the mysql query to remove topics& messages with less than x views
Kirjoitti: vbgamer45 - heinäkuu 05, 2008, 09:17:23 IP
There is not an easy single sql query but you could use the removepost topic functions built in smf.
Do a lookup in the topics for the category id and remove the topics that have less than a certain amount of views in a topic.

If you do it via sql likely things won't be removed completely, stats wrong etc.