Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


sweet table design

By Jaqui ·
for a threaded discussion.

The field names:
post_id root_id parent_id subject content Author Date

this will actually allow for the tree view of the TR forums will all but use login contained in the one table.
root_id is the thread head subject, such as the Software/Web Development this thread is posted in.
parent_id is equal to root_id for originating post of a discussion.
post_id is the actual posting. [ naturally ]

so a query run agains this table tests for root id to display the topic, parent id to display previous post, testing these two for being equal to see if this is a discussion starter.
if a mid discussion posting then put links to previous post and next post. :)

naturally this is a basic table, by adding fields for tags or other searchable content you gain more flexability in the user interaction.

this table actually uses far less overhead in the database than most, since only the very first call to the display script will not have a "select all from table where parent_id && post_id = " line in the query, meaning it's selecting where root_id = 0 ( discussion Front Page ) after the front page you are either selecting a specific thread, or a specific subject grouping.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by Oz_Media In reply to sweet table design

I thought you were gonna pull a Martha Stewart and show us how to create a center piece from an old doily, wool and a toilet roll!

Collapse -


by Jaqui In reply to Damn

to disappoint you Oz. ~G~

Collapse -

Nice to see...

by illilli In reply to sweet table design

...some posts of a purely technical nature. No arguing, just a post of a table with some fields and light discussion as to how sweet it is! Thanks.

Related Discussions

Related Forums