背景:
python 更新mysql数据库报错:
插入语句:
update t_question_re_math set error_info='',img_latex='\frac { 1.1 } { 1 + 8.2 \% }' where id=1048
报错:
unsupported format character '}' (0x7d) at index 83
原因:
sql 语句中包含%
修改:
sql=sql.replace('%','%%')
背景:
python 更新mysql数据库报错:
插入语句:
update t_question_re_math set error_info='',img_latex='\frac { 1.1 } { 1 + 8.2 \% }' where id=1048
报错:
unsupported format character '}' (0x7d) at index 83
原因:
sql 语句中包含%
修改:
sql=sql.replace('%','%%')