Oke dan maar, we doen het op jou manier

Kan je je code ombouwen naar de volgende database structuur?
Spoiler tonen
Codeblok (forumreactions):
1
2
3
4
5
6
7
8
9
CREATE TABLE IF NOT EXISTS `forumreactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`topic_id` int(11) NOT NULL,
`message` varchar(3000) NOT NULL,
`author` int(11) NOT NULL,
`type` int(11) NOT NULL,
`date_posted` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4614 ;
Codeblok (topics): 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE TABLE IF NOT EXISTS `topics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(45) NOT NULL,
`author` int(11) NOT NULL,
`message` varchar(10000) NOT NULL,
`type` int(11) NOT NULL,
`gesloten` enum(0,1) NOT NULL,
`sticky` enum(0,1) NOT NULL,
`del` enum(0,1) NOT NULL,
`date_posted` datetime NOT NULL,
`catid` int(11) NOT NULL,
`last_reaction` datetime NOT NULL,
`views` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=539 ;
Codeblok (cats): 1
2
3
4
5
6
7
8
9
CREATE TABLE IF NOT EXISTS `cats` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(60) NOT NULL,
`description` varchar(3000) NOT NULL,
`tottopics` int(11) NOT NULL, // HIER MOET HET WORDEN GETELD
`allowed` int(11) NOT NULL,
`up` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;