I’m writing some books for a website where the contents will be accessed through a database (MySQL) and shown on slides (using PHP and JQuery). A slide here is a chunk of HTML data to output for that particular slide.
Now what I want to achieve is some Powerpoint-esque technique where paragraphs and bullet points become added to slides, for example:
Slide one:
<p>Lorem impsum...</p>
Slide two:
<p>Lorem impsum...</p>
<p>Dolor sit amet...</p>
In other words, there is going to be a lot of redundant information because of how most slides contain text already available in other slides. So is there a reasonably easy way to structure the database for this or should I rather save the full text of each slide as it is?
The structure I have right now is:
books
id
name
chapters
bookid references books.id
chapterno
chaptername
sections
bookid references chapters.bookid
chapterno references chapters.chapterno
sectionno
sectionid references sectiontexts.id
sectiontexts
id
text
One of the other problems here for example is, if say a chapter has 10 slides and I delete slide 3, then I will have to change section numbers of sections 4-10.
I’d save the full text of each slide. It’s a reasonably common occurrence for users to have subsequent slides in PowerPoint presentations that modify the previous contents. As well, the amount of data required to store each slide is really very small, since you’re dealing with text data, and the size increase is so small that it doesn’t even particularly matter when pitted against the increase in complexity of the slide-to-previous-slide association design. Go with full text for each slide.