我有一个 html 编辑器,我试图将它生成的 html 插入到数据库中,然后在另一个页面中检索它,该页面是 SQL 表。我正在使用一个带有 asp 3.5 文本字段的表格。这是代码:
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();
这是我得到的错误:
您的 SQL 语法有错误;查看与您的 MySQL 服务器版本相对应的手册,了解在 'font-size: 18pt; 附近使用的正确语法。行高:115%;font-family: "arial","sans-serif";'>Whatever' 在第 1 行
如何才能做到这一点?提前致谢。