Jump to content

creating subforums or subcategories


tjhilder

Recommended Posts

Hi,

I have a table called forums

[code]
`forum_id` INT(11) NOT NULL AUTO_INCREMENT,
`title` VARCHAR(100) NOT NULL,
`subtitle` TEXT NOT NULL,
PRIMARY KEY (forum_id))
[/code]

which works well. but now I want to add sub forums, so I thought I would do it this way:

[code]`subforum` INT(11),[/code]

but it seems doing a value of (forum_id being 2 would mean subforum's going in forum_id 2 would be that X

but no idea how to group them, since I already group them by forum_id.

I have these tables also:

topics
[code]
`topic_id` INT(11) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL,
`title` VARCHAR(100) NOT NULL,
`article` TEXT NOT NULL,
`views` INT(11) NOT NULL,
`member_id` INT(11) NOT NULL,
`forum_id` INT(11) NOT NULL,
PRIMARY KEY (topic_id))
[/code]

'replies'
[code]
`reply_id` INT(11) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL,
`article` TEXT NOT NULL,
`member_id` INT(11) NOT NULL,
`topic_id` INT(11) NOT NULL,
PRIMARY KEY (reply_id))
[/code]

so I'm wondering if better to do a table called subforums instead? would this work better or is there a sollution to my already made table?

thanks for reading.
--
TJ

Link to comment
https://forums.phpfreaks.com/topic/22876-creating-subforums-or-subcategories/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.