unsider Posted July 6, 2008 Share Posted July 6, 2008 This isn't directly code related, but it is a PHP question, if not, feel free to moce to appropriate question. I am trying to design a comment system, but have the ability to retrieve/determine the following: count the #, comments (42) the ability to edit/delete check the existence of comments While not complex, it is absolutely necessary. Should I use a DB do this? Or Not. My only concern with DB is that each article will most likely have dozens of comments and that adds up, and even time a query has to retrieve the comments for that particular article, and the output could become slow. I've never allowed the existence of comments on my sites, so I'm kind of new to this. Sorry for my ignorance. If there is another method, or other ideas to make that possible as effeciently as possible, please let me know. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/ Share on other sites More sharing options...
pocobueno1388 Posted July 6, 2008 Share Posted July 6, 2008 Most definitely use a database. To speed up the output of the comments, use pagination. That way it's only fetching a handful of comments at once. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582640 Share on other sites More sharing options...
DarkWater Posted July 6, 2008 Share Posted July 6, 2008 Of course you'd use a database. Also, the page will not be slower with your "dozens of comments". Just look at forums. They aren't slow and think of all the stuff that it has to do! You'd have a separate comments table which would be associated with each article by a unique article_id. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582641 Share on other sites More sharing options...
gigas10 Posted July 6, 2008 Share Posted July 6, 2008 im pretty sure that the speed of a mysql select query to search for comments would be limited to the servers speed, i have a table that has about 50 million rows and i can select certain rows from it in less then a second. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582646 Share on other sites More sharing options...
unsider Posted July 6, 2008 Author Share Posted July 6, 2008 Alright, I just needed reassurance, I know the forums, used a DB heavily, but not necessarily how heavily (never takin a look at the code in-depth). Thanks though EDIT: wow...that settles it then. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582647 Share on other sites More sharing options...
gigas10 Posted July 6, 2008 Share Posted July 6, 2008 Make sure to index your tables, as they grow they will slow down unless you index them. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582702 Share on other sites More sharing options...
unsider Posted July 6, 2008 Author Share Posted July 6, 2008 Already on top of that Thanks for the tip though. Quote Link to comment https://forums.phpfreaks.com/topic/113399-solved-best-method/#findComment-582707 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.