MySQL データベースのフィールドに HTML コードを挿入しようとしています。
私はそれを行うために次のコードを使用します
cur.execute("INSERT INTO `table1`(field1) VALUES("+ str(data) +")")
しかし、次のエラーが表示されます。
_mysql_exceptions.ProgrammingError: (1064, '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 \'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.or\' at line 3')
どうすればこの問題を解決できますか? 前もって感謝します!