in reply to Textarea to edit HTML?

You want to treat the contents of the database as text, so you need to consider it text. As such, you need to convert it to HTML by escaping anything HTML might find interesting (using encode_entities).

For example, the HTML for "Rock & Roll" is

Rock & Roll
The HTML for a textarea initialised to that string is
<textarea>Rock &amp;amp; Roll</textarea>