向mysql数据库插入数据时经常会碰到一些特殊字符,如单引号,双引号。
cur.execute(u'''update table set name = %s where id = %s;''' , (p.decode('utf-8'),index))
name = "\\";
name2 = "\""
注意:
向mysql数据库插入数据时经常会碰到一些特殊字符,如单引号,双引号。
cur.execute(u'''update table set name = %s where id = %s;''' , (p.decode('utf-8'),index))