chrischen Posted November 20, 2008 Share Posted November 20, 2008 I'm trying to create a commenting system that has the ability to nest comments. So basically within the database each comment has a "comment_parent" value pointing to the ID of the parent comment. I use a linked list to organize and return the comments with each child under the respective parent. This works great if I have all the comments on one page. But I need to have some form of pagination and here's where the problem arises. If I paginate by limiting the query then because the child and parent comments may not be together in the database some child responses may be missing if it is not in the query. And if the child response shows up later in a query it will not display because its parent is not there. So basically I need a solution that can display the top level comments by date and show the child and sibling comments while maintaining an X number on each page. And if a child spills onto the next page it should still display. The only solution I have now is to retrieve the top level comments and then have multiple query loops to retrieve each child. But i'm assuming that's not very efficient. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/133464-commenting-system/ Share on other sites More sharing options...
chrischen Posted November 23, 2008 Author Share Posted November 23, 2008 Ok well, I decided to not use pagination. Quote Link to comment https://forums.phpfreaks.com/topic/133464-commenting-system/#findComment-697260 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.