Save html text in database
I want to save html-formatted text to the database, but when I do this, it does not save html characters like </ "> 'and others. Here's how I read an article from the database for editing:
<p class="Title">і і:</p>
<textarea name="EN" cols="90" rows="20" value="<?php echo htmlentities($articleArr['EN'], ENT_QUOTES, "UTF-8"); ?>" ></textarea>
after that it generates the following html code:
<p class="Title">і і:</p>
<textarea name="EN" cols="90" rows="20" value="<p class='Title'> </p>" ></textarea>
So, I expect this text to appear in my text box, in the html code of this page it is, but not in the text area.
In the database, I save it as:
<p class="Title"> Hello </p>
So how can I do this:
- Read from the HTML-FormattedText database.
- Show in textarea element.
- Edit and save it in the database.
Please help me, how can I save such texts correctly, Thanx!
nvarchar (max).
, .
http://www.aspnet101.com/2007/03/parameterized-queries-in-asp-net/
http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/
Sql, Mysql aslo