Jump to content

Recommended Posts

Hi...

 

I want to create a fully functional forum, like PHPBB, maby not as advanced but that does the same job. I do this to teach myself a huge amount of PHP and MySQL. I´ve done PHP and MySQL programming for 6-7 years but just on a hobby basis, so I´m familiar with writing the code.

 

I sat down to brainstorm a bit about the project when i got to the structure of the database i hesitated on how to do a good structure for a forum database.

 

I thought first of all to have all the forum posts in one table with relation to the forum subject and topic table. But i thought that having all the posts in one table might be a slow system? Should the posts be separated or is this ok? I understand that this depends on the size of the forum and the amount of posts in the database.

 

How do you do a good database structure in a table with a huge amount of rows that should go in the same table?

 

First table layout:

Forum name - cars or flowers?

Topic name - carburetors or Daisies (a relation to forum topic so it organizes under the correct forum name)

Forum post - how do i grow a daisy? (a relation to both topic name and forum name for organizing)

 

Link to comment
https://forums.phpfreaks.com/topic/226259-new-db/
Share on other sites

Browse through my source here: https://github.com/ttocskcaj/The-Forum-Framework/

Pretty much, I have 3 tables to handle the posts.

* forum  - different categories for threads to go in. Eg "PHP Coding Help"

* thread - eg "New DB"

* post - eg "Re: New DB"

 

Each post belongs to a thread, and are linked with an ID (integer).

Each thread belongs to a forum ane are linked with an ID (iteger).

Each post is also linked to a user with an ID.

 

I have a different class to handle each table, kind of like a model (in MVC) I guess.

 

Here's the sql for my database.

https://github.com/ttocskcaj/The-Forum-Framework/blob/master/sql/tffw_sql.sql

 

Keep in mind that I'm still working on mine to.

Link to comment
https://forums.phpfreaks.com/topic/226259-new-db/#findComment-1168749
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.