I'm using C# Net and MySQL Is there function or someting to write html code to MySQL database? I'm using MySQL Connector/Net dll file. Comunication with database is via SQL strings. I think the problems are those stupid characters in html.... Thanks on your time...
The only reason that I could think of that it wouldn't write to database is because of the quotes (" ") within the HTML. If it is simple HTML, with no javascript, the easiest way would be to replace these with single quotes (' ') before you execute the SQL statement. This will not work if you have html like: <a href="javascript:myFunction('1')">
But be aware that you need to be careful of SQL injection when running SQL queries in this manner. If this page is going to be available publicly, especially if it is a commercial page, then you need to use another method to add items to the database.
Used command parameters and just assign the HTML string variable to the parameter, that way you dont have to worry about the quotes or special characters.
You can put any html in the SQL database when you make the field a text field. If you are putting URLs in the field, use single quotes as suggested above. But for the most part use as little formatting as possible. Do your formatting with CSS.