Jump to content

[SOLVED] Best method ?


unsider

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.