CONTEXT:
My project is a CMS website, and each user's CSS is held in a database table. Fields are:
int id primary
int site_id index
string selector
string property
string value
bool important
When a user's website is pulled up, it's a simple query:
SELECT * FROM css_table WHERE site_id = $this_site_id
And using PHP the rows are processed and turned into proper CSS.
THE QUESTION:
I need to go in reverse now.
There will be a Advanced CSS mode that will give the administrators a raw CSS editor. The table rows will be processed once more to populate the textarea and allow editing. Now it has to get back into the database. How do I process this new CSS back into separate, insertable fields?