I built a really basic php / mysql site for an architect that uses a single "projects" table. The website presents various projects that he has worked on.
Each project contained one piece of text and one series of images.
Source project table (create syntax):
CREATE TABLE `projects` (
`project_id` int(11) NOT NULL auto_increment,
`project_name` text,
`project_text` text,
`image_filenames` text,
`image_folder` text,
`project_pdf` text,
PRIMARY KEY (`project_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
The client now requires the following, and I'm not sure how to handle the extensions in my database. My suspicion is that I will need an extra table.
Each project now has "pages".
Pagescontain either ...
- Single image
- One piece of text
- One image and one piece of text.
Each page can use one of three layouts.
4 ( ), , .
( ):
CREATE TABLE `projects` (
`project_id` int(11) NOT NULL AUTO_INCREMENT,
`project_name` text,
`project_pdf` text,
`project_image_folder` text,
`project_img_filenames` text,
`pages_with_text` text,
`pages_without_img` text,
`pages_layout_type` text,
`pages_title` text,
`page_text_a` text,
`page_text_b` text,
`page_text_c` text,
`page_text_d` text,
PRIMARY KEY (`project_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
MYSQL . !