Python3 problem when using a string containing the database operation pymysql single or double quotation marks ( "" / '') of the

Error Messages

pymysql.err.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 \'fas好",\'wozhidaole知道了\'" where title = "好"\' at line 1')

Solution: Before pay more step conversion

pymysql.escape_string(str)

 



Guess you like

Origin www.cnblogs.com/542684416-qq/p/11804781.html