Forum Moderators: phranque
So the ideal option seemed to be storing a PHP array containing each set in the content field. However, this doesn't seem to be possible.
Are there any standard approaches to dealing with this sort of thing?
That's what I've just been reading.
>> If you want multiple content for a single entitiy you will need 3 tables
That's what I was afraid of. So I guess if there's no way of knowing how many "pages" there will be in an "article", I'll have to make an educated guess about the maximum amount. If it doesn't fill all the spaces, they'll just be left blank. Maybe include a way for the system to add columns if needed...
Thanks
[articles]
id
title
topic
etc
[copy]
cid
copy
[full_article]
id
cid
The article table contains the info regarding the article as it pertains to describing the article. The copy table contains copy segments. Break up the full content as many times as you'd like. The full_article table is where you blend the two together to build a complete article. It would look like:
[full_article]
id ¦ cid
1 ¦ 01
1 ¦ 02
1 ¦ 109
This allows for the most flexibility based on what you're asking for.
serialize and unserialize functions. A more elegant way would be to use a page-breaking delimiter in the text and use PHP's
split function to break the page into an array once fetched.
SN