I have a strange problem:
In the database, I have a literal ampersand lt semicolon:
<div
whenever its printed into a html
You have to be sure that this is rendered to the browser:
Essentially, this means that the & in < has to be html encoded to &. How to do it will depend on the technologies you're using.
UPDATE: Think about it like this. If you want to display Having said this, if you want to display <> because otherwise,
<div> inside a textarea, you'll have to encode & again, because the browser decodes HTML entities when rendering HTML. It has nothing to do with your database.