sqlite3报错:错误类型求解决方案
for i in range(10):if id_list == 0:
pass
else:
quantity_ago = cursor.execute('select quantity from %s where id = ?' % username,id_list)
print(quantity_ago.fetchall())
cursor.execute('update %s set quantity = ? where id =?' % username,(quantity_list,id_list))报错: quantity_ago = cursor.execute('select quantity from %s where id = ?' % username,id_list)ValueError: parameters are of unsupported typeid_list,quantity_list 均为纯int类型的list数据库:quantity integer类型 ; id 主键自增 integer类型求解决方案 这语法是用 ? 的么
quantity_ago = cursor.execute('select quantity from %s where id = %s' %( username,id_list))
试试 ,没用过SQLite,只用MySQL JuncoJet 发表于 2022-2-17 15:35
这语法是用 ? 的么
quantity_ago = cursor.execute('select quantity from %s where id = %s' %( username ...
pymysql是用%s
sqlite3是用?的
页:
[1]