WEB Forumn Database Structure?

Discussion in 'OT Technology' started by Fase, Nov 3, 2009.

  1. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    I've been a lot more SQL work recently and got to thinking how are forums structured?

    Would each thread be a table, and each subforum a database?
    i.e. this thread being a table in database "The Webmaster Lab".
     
  2. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    No. One tables holds all the posts, there are usually ThreadIDs in there. One table holds all the threads, there are usually ForumIDs in there. One table holds all the forums, some will have LastPostID type info in there.

    Why not grab PHPBB and install it and poke around.
     
  3. Swerve

    Swerve OT Supporter

    Joined:
    Feb 20, 2005
    Messages:
    3,175
    Likes Received:
    3
  4. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    Damn that was my second guess, but I can only imagine something like OT's offtopic being such a massive table.
    I shall look into PHPBB.
     
  5. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    Don't use phpbb as a reference. Check out vbulletin.
     
  6. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    :rofl: seriously
     
  7. Swerve

    Swerve OT Supporter

    Joined:
    Feb 20, 2005
    Messages:
    3,175
    Likes Received:
    3
    w3schools I think
     
  8. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    It's not free though?
     
  9. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    Yeah I use that a lot.
     
  10. 95vr4

    95vr4 OT Supporter

    Joined:
    Oct 6, 2004
    Messages:
    2,513
    Likes Received:
    0
    Location:
    Weddington, NC
    W/ vbulletin (what OT uses) there's a forum table, thread table, and post table

    http://rapidshare.com/files/302153642/vb.sql.html
    ^^vbulletin sql dump

    No but any forum that's worth having is well worth the $200 license
     
  11. Supergeek

    Supergeek New Member

    Joined:
    Jan 23, 2007
    Messages:
    1,855
    Likes Received:
    0
    Location:
    Colorado
    vBulletin goes overboard on tables. I can't imagine it really needs that many, and maybe part of why they decided to start over with a new codebase. Anyone know offhand how many tables in vBB v4?
     
  12. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    Thanks, taking a look.
     
  13. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,638
    Likes Received:
    13
    Location:
    Atlanta
    I made a forum for a final project in my PHP class. This is how i did it.

    Forum Table with:
    forumID
    forumName
    viewableTo
    Description

    Thread Table with:
    threadID
    forumID
    title
    stickyID
    userID
    date
    timestamp
    displayID

    Posts table with
    postID
    threadID
    comment
    quoteID
    userID
    date
    timestamp

    Worked out just fine.
     
  14. Supergeek

    Supergeek New Member

    Joined:
    Jan 23, 2007
    Messages:
    1,855
    Likes Received:
    0
    Location:
    Colorado
    If you read up on database normalization, 1st through 3rd form, you'll understand. Don't bother with 4+.
     
  15. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    Alright.

    Any book recommendations on database structures?
     
  16. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,638
    Likes Received:
    13
    Location:
    Atlanta

    :werd: 4th is rarely used (at least from what i've learned)
     
  17. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    NICE...
     
  18. Kevin

    Kevin New Member

    Joined:
    Aug 27, 2002
    Messages:
    87,634
    Likes Received:
    0
    Location:
    Michigan

Share This Page