save html-formatted text to database
Try using htmlspecialchars()
on the string to put into the DB, and then, when pulling it back out, use htmlspecialchars_decode()
. Might make a difference.
Save it to a nvarchar(max) field.
Make sure you use parameterized queries for security. Read
http://www.aspnet101.com/2007/03/parameterized-queries-in-asp-net/
http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/
with little changes to Sql , you can apply to Mysql aslo