Results 1 to 2 of 2
Jun 2, 2001, 05:54 #1
- Join Date
- Jun 2001
- 0 Post(s)
- 0 Thread(s)
Database design for dynamic content
I'm trying to design a DB to accomodate page content to be output through 'templates'.
I've come up with a nice two table system for this but if I want to have different 'sections' in my site using different fields in the table concerned Should I have a DB for each section (say product reviews, articles etc) or is there a way to keep it all in the same DB.
How is this normally achieved?
Can anyone show me an example?
Below is the schema for my two table system(good for one 'section':
CREATE TABLE head (page_id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, prev SMALLINT(4) UNSIGNED NULL, date DATE NOT NULL, title VARCHAR(60) NOT NULL, keywords VARCHAR(150) NOT NULL, description VARCHAR(150) NOT NULL, PRIMARY KEY(page_id));
CREATE TABLE content (page_id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, headline VARCHAR(150) NOT NULL, subhead VARCHAR(150) NOT NULL, text TEXT NOT NULL, PRIMARY KEY(page_id));