Creating a Message Board

Creating a Message Board

Post by Mike » Thu, 30 Aug 2001 01:18:15



Hello everyone.  I have came accross a dilema. I'm pretty sure some of you
have created a message board before.  My question pertains to this and how
the db structure should be.

I could create something like this

------------------------------------------------
TableName:  Messages
Field:  MessageID
Field:  Title
Field:  Subject
Field:  NumberOfReplies

TableName:   Replies
Field:  ReplyID
Field:  Title
Field:  Subject
Field:  MessageIDLink, foreign key to Messages.MessageID
-----------------------------------------------------

Now this design would allow a message to have replies, BUT it doesn't allow
a reply to have another reply and that reply to have a reply and so on.  I
could create like 100 tables to go deeper in the replies but I don't think
that would be necessary.  There has to be a shortcut.

Could anyone help out with this and the db structure for this.

TIA

Mike

 
 
 

Creating a Message Board

Post by Dan Farin » Thu, 30 Aug 2001 01:29:19


Maybe you should give each message a parentid so that it can be linked to
another message. Top level messages could have a parentid of NULL.

--
Dan Farino
Sr. Systems Programmer
Stamps.com, Inc.


Quote:> Hello everyone.  I have came accross a dilema. I'm pretty sure some of you
> have created a message board before.  My question pertains to this and how
> the db structure should be.

> I could create something like this

> ------------------------------------------------
> TableName:  Messages
> Field:  MessageID
> Field:  Title
> Field:  Subject
> Field:  NumberOfReplies

> TableName:   Replies
> Field:  ReplyID
> Field:  Title
> Field:  Subject
> Field:  MessageIDLink, foreign key to Messages.MessageID
> -----------------------------------------------------

> Now this design would allow a message to have replies, BUT it doesn't
allow
> a reply to have another reply and that reply to have a reply and so on.  I
> could create like 100 tables to go deeper in the replies but I don't think
> that would be necessary.  There has to be a shortcut.

> Could anyone help out with this and the db structure for this.

> TIA

> Mike


 
 
 

1. Creating Message Boards

I need to create a message board for a website. I've never done this
before and don't know what my options are (i.e., Java, shrinkwrapped
package, etc.)

I'd appreciate some input as to my options, as well as any pointers to
websites containing the information I'm looking for.

Thank you.

Toni A. Parra

2. Access ODBC Connectivity to Sybase

3. New 'Creating Message Board' Beta chapter

4. User id when record is locked

5. A Great Tech Message Board

6. Using a Stored Procedure to send email WITHOUT SMTP

7. Efficient paging in an message board system

8. Anyone used BenchBrokers.com

9. Message Board

10. Displaying Page Views for Messages in Discussion Board

11. Displaying page views for messages in Discussion Board

12. SQL message boards

13. SQLXML Message Board - Testers Needed