The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 6 of 6

Thread: PHP/MySQL Comment System

  1. #1

    PHP/MySQL Comment System

    I have something like 100 different items stored in a database. I want to create a comment system for each one and I was wondering what the best approach would be for something like this.

    1. Create a separate database for comments and have each item with its own table within that database to store the comments information.

    2. Create a table within the existing database and just store all comments withing that table and pull them according to whichever item the visitor is viewing.

    I was wondering which method would be quicker and better, or any other ideas on how to accomplish this.

    Thanks in advanced.
    Last edited by cubed; December 28th, 2007 at 10:17 PM.

  2. #2
    Give all the items an id.

    Then make a comments table. Create an items_id column, and just reference comments by items_id.

  3. #3
    That was my second idea but I wasn't sure if I would run into any kind of lag issue with such a giant table. Do you know if there really would be any kind of speed differences between the two options I mentioned?
    Last edited by cubed; December 28th, 2007 at 10:27 PM.

  4. #4
    I'd say the separate database with multiple tables is way messy and inefficient.
    got pwnt?

  5. #5
    I thought it would be more organized, but I guess I'll be sticking with just a single table. Thanks for the help guys!

  6. He's right. Not only would your first idea be unorganized and turn into a HUGE mess after time went on, but it would require more of a server load to close the first database connection and open it up again to get into the separate db. The separate table method is time tested and is quite probably the best and most efficient way to do it.
    "Give me the place to stand, and I shall move the earth" - Archimedes
    "The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts." - Bertrand Russell

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012