python的mysql模块,参数使用%s传入,涉及到like时就各种出错
折腾半天,终于搞定
sql = "select * from table where field like %s"
value=(param)
cursor.execute(sql,value+'%%')
表示一个百分号,得用%%来表示
python的mysql模块,参数使用%s传入,涉及到like时就各种出错
折腾半天,终于搞定
sql = "select * from table where field like %s"
value=(param)
cursor.execute(sql,value+'%%')