显然,一旦MySQL中的记录ID超过一位,通常是这样的:
c.execute("DELETE FROM <table_name> WHERE id = %s, "thwart(str(element['id'])))
停止工作。
是什么原因造成的??
要执行的第二个参数应该与您的查询参数一起可迭代。代替:
c.execute("DELETE FROM <table_name> WHERE id = %s", thwart(str(element['id'])))
和:
myid = thwart(str(element['id']))
c.execute("DELETE FROM <table_name> WHERE id = %s", (myid, ))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句