文件 C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\mysql\connector\cursor.py,第 1149 行,在执行 elif len(self._prepared[parameters]) != len (参数):类型错误:int 类型的对象没有 len()
问题是当我们传递单个参数时,python 会出错,我们需要将逗号(,)放在第一个参数的末尾。像下面这样
input=(customerId,)
cursor.execute(sql, input)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句