MySQLdb.escape_string(): 转义特殊字符
sql语句如果不对特殊字段进行转义,可能运行出错,比如 update student set name = ""小明" where id = 1;
遇到这种情况,可用MySQLdb.escape_string(进行转义)
unicode 和 str (python2中)
后端接收到前端传来的参数,字符串都是unicode类型
sql语句如果不对特殊字段进行转义,可能运行出错,比如 update student set name = ""小明" where id = 1;
遇到这种情况,可用MySQLdb.escape_string(进行转义)
后端接收到前端传来的参数,字符串都是unicode类型