Mysql forum lay out Need opinion
Posted: Fri Jul 23, 2004 4:16 pm
Ok, i'm writing a mini forum for my site and quite frankly i don't know if my sql design would work or not and i really need opinions from the community. Stick with me as i describe whats going on.
First i have my main forum sql. Which is fine i am sure. But this houses the forum name's and description.
forum_id bigint(5) No auto_increment
name varchar(155)
description text
I dont' seem to have any problems with this. But here comes my delema.
I have one more table called threads. Now this table houses all the topics in the viewforum.php and all the threads period. I identify them together by id.
id bigint(5) auto_increment
tid bigint(5)
topic_id varchar(155)
topic varchar(155)
uname varchar(155)
body text
forum_id bigint(5)
date varchar(25)
Now id is auto_increment and that is just to id the rows.
Then i have tid (thread id) This links together the topic and the thread. So my view thread statement views all threads with the tid of whichever.
topic_id if is set to 1 tells the first post with the tid number to display in the view forum topics. if set to anythign else it is just a basic thread reply.
Will this work ok or does anybody have any suggestions?
Thank you
Anthony
First i have my main forum sql. Which is fine i am sure. But this houses the forum name's and description.
forum_id bigint(5) No auto_increment
name varchar(155)
description text
I dont' seem to have any problems with this. But here comes my delema.
I have one more table called threads. Now this table houses all the topics in the viewforum.php and all the threads period. I identify them together by id.
id bigint(5) auto_increment
tid bigint(5)
topic_id varchar(155)
topic varchar(155)
uname varchar(155)
body text
forum_id bigint(5)
date varchar(25)
Now id is auto_increment and that is just to id the rows.
Then i have tid (thread id) This links together the topic and the thread. So my view thread statement views all threads with the tid of whichever.
topic_id if is set to 1 tells the first post with the tid number to display in the view forum topics. if set to anythign else it is just a basic thread reply.
Will this work ok or does anybody have any suggestions?
Thank you
Anthony