Hello,

I am writing this simple web app that produces CSS pages (views) based on user input.

My predicament:

(page1.css)

Code CSS:
.foo { height: 50px; }
.baz { height: 22px; }
.bing { height: 13px; }

(page2.css)

Code CSS:
.foo { height: 50px; }
.bing { height: 13px; }
.baz { height: 22px; }
.bar { height: 48px; }

A third page might be a combination of the above two css pages:

(page3.css)

Code CSS:
.foo { height: 50px; }
.baz { height: 22px; }
.bing { height: 13px; }
.bar { height: 48px; }

Note: Duplicate css has been merged.

In terms of data, page1.css and page2.css are both generated from multi-dimensional arrays. With that said, page3.css will be a combination of page1.css and page2.css array data.

With me so far?

My question:

In terms of database storage, should I store the 1) original array data, 2) raw CSS, or 3) a delimited string?

In other words, when my script creates the third page, it has to combine pages one and two... How should I store the data from the first and second pages in the database in order to generate a third, combined, css page?

I hope that makes sense...

I am not looking for code, I am just curious 'bout best practices. Seems like maybe a delimited string would be a good option... Or would storing the full CSS page and applying string replace functions be just as fast? Or, would storing the original arrays be the best option? It seems like storing the original arrays would be the option with the least amount of fuss (I already have the PHP to parse the arrays and generate a CSS page), but is storing array data in the DB not good practice?

Any tips ya'll could send my way would be great!

Many TIA!

Cheers,
Micky