Jump to content

mysql basic forum help deleteing inactive threads


turkman

Recommended Posts

Hey guys ive probably set my basic forum up badly but i wanted to keep it as simple as possible. Basically the forum is as follows.

 

ID (int)

ReplyToo (int)

image (varchar 200)

message (txt)

Lastpost datetime

ipaddr (varchar 200)

 

Basically when someone creates a new thread it gets an auto id and the replytoo status is set to 0 to let me know its not a reply.

 

When every a reply is made it will have its own id and the replytoo value will be the id of the thread its a reply too. Also whenever a reply is made it will look up the first post (the one its replying too) and set the lastpost value of that to the same as the lastpost of its replies.

 

Now here is where the problem comes in. I'm looking to add a prune function. I basically want to keep the 100 most recently commented on threads.

 

The problem being that i have to somehow check the ids laspost but then make sure anything that has a replytoo value the same as the id isnt deleted.

 

so basically its not the 100 most recent posts kept... its the 100 most recent threads kepts with all their posts.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.