turkman Posted February 28, 2010 Share Posted February 28, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/193688-mysql-basic-forum-help-deleteing-inactive-threads/ Share on other sites More sharing options...
fenway Posted March 1, 2010 Share Posted March 1, 2010 You're talking about storing hierarchical data -- not trivial, many tutorials around, including on the stickyl Quote Link to comment https://forums.phpfreaks.com/topic/193688-mysql-basic-forum-help-deleteing-inactive-threads/#findComment-1020127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.