I'm trying to program my own board/forum

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Arvid_Falk
Forum Newbie
Posts: 3
Joined: Wed Jul 26, 2006 8:13 am

I'm trying to program my own board/forum

Post by Arvid_Falk »

Hi guys,

I'm currently programing my own board/forum. But unfortunately I'm experiencing trouble while designing the table. All work the fine when I post a topic but I've difficulties when I link messages, post and replies between them.

So my question is basic. How should I desing my table properly.

Thx for you help

Regards,

PS: I'm using PHP/MySQL and I only need the structure of the SQL's tables.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Here is the database structure for phpBB

SQL
Arvid_Falk
Forum Newbie
Posts: 3
Joined: Wed Jul 26, 2006 8:13 am

Post by Arvid_Falk »

astions wrote:Here is the database structure for phpBB

SQL
Thx. My Database is a bit more light....
GM
Forum Contributor
Posts: 365
Joined: Wed Apr 26, 2006 4:19 am
Location: Italy

Post by GM »

Cheers for that astions - nice to see other designs so I can compare them with my own.
Thx. My Database is a bit more light....
So just take the users, forums, topics and posts tables, remove the fields you don't want, and from that you should be able to make a pretty much working forum (albeit a very basic one).
Arvid_Falk
Forum Newbie
Posts: 3
Joined: Wed Jul 26, 2006 8:13 am

Post by Arvid_Falk »

GM wrote:Cheers for that astions - nice to see other designs so I can compare them with my own.
Thx. My Database is a bit more light....
So just take the users, forums, topics and posts tables, remove the fields you don't want, and from that you should be able to make a pretty much working forum (albeit a very basic one).
That's what I did.
alvinphp
Forum Contributor
Posts: 380
Joined: Wed Sep 21, 2005 11:47 am

Post by alvinphp »

Here you go....

[tbl_topic] lists all your topics (key is topic_id)
[tbl_post] lists all your posts (key is post_id, foriegn key is topic_id and user_id)
[tbl_user] lists all your users (key is user_id)

When a person creates a new topic you will insert a record in tbl_topic and then their initial posts in tbl_post. When someone replies to the topic you just insert a record into tbl_post.
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

i have 5 tables for my forums that i wrote. the only 'hard' thing about my forums as is, is getting to show the main page. after that the code comes so easilly. 3 files too. less than 400lines of code. although there is no admin just yet lmao! soon enough
Post Reply