hi, I decided to build a quick forum system for my site. nothing too advanced...heres the db setup i have.

create table ForumsTopics
id int auto_increment not null,
topic_id varchar(7) not null,
title char(100) not null,
cat char(1) not null,
views char(6) not null,
date DATETIME not null,
last_mod TIMESTAMP not null,

create table ForumsThreads
id int auto_increment not null,
username varchar(16) not null,
topic_id varchar(16) not null,
message varchar(7500) not null,
created DATETIME not null,
last_modified TIMESTAMP not null,

I realized I don't need two seperate tables, ForumTopics & ForumThreads.

By setting it up in two tables, I will have to select from two tables to retrieve the topic title and message when displaying the message page. But when viewing the forum topics page, I will need to select from one table.

I want to design this so its as efficient as possible, and memory storage is not a problem. Meaning, I want a database setup that will sacrafice space rather then processesing speed.

Now if I decide to make just one table to include the topic , category , message body , etc. then all my SELECTS will only need to select from ONE table. But if this application was built to serve thousands viewing at the same time, then would having two tables help efficiency since it will reduce the loads?

Thanks for taking your time to read this.


10 Years
Discussion Span
Last Post by tech291083

hi there,

i m also learning php and mysql at the moment at a very slow but lively pace. i am using this book. very good one :

PHP and MySQL Web Development
by Luke Welling, Laura Thomson




if you go to the above link (sams site), there is a zip file that has all the code of the book which can help you learn and the most important thing is there is a chapter dedicated to building an online forum using php+mysql.

Chapter 29. Building Web Forums

hope this helps,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.