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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.