sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied

后端 未结 2 505
既然无缘
既然无缘 2020-11-22 06:52
def insert(array):
    connection=sqlite3.connect(\'images.db\')
    cursor=connection.cursor()
    cnt=0
    while cnt != len(array):
            img = array[cnt]
          


        
2条回答
  •  失恋的感觉
    2020-11-22 07:39

    cursor.execute(sql,array)
    

    Only takes two arguments.
    It will iterate the "array"-object and match ? in the sql-string.
    (with sanity checks to avoid sql-injection)

提交回复
热议问题