I have an html editor and I am trying to insert the html it generates into the database and then retrieve it in another page where is the SQL table. I am using a table with one text field with asp 3.5. Here is the code:
MySqlConnection con = new MySqlConnection(@"Connection String ");//I've tested the connection string and its working fine
MySqlCommand cmd = new MySqlCommand("INSERT INTO ins (tes) VALUES ('" + Editor1.Content + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
This is the error I get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'font-size: 18pt; line-height: 115%; font-family: "arial","sans-serif";'>Whatever' at line 1
How can this be done? Thanks in advance.