Hello! Can you help me?
I have tested in several ways, but I could not understand.
With up to 3 variables this form works, however with 7 variables it presents the error in the image below.
I've been stuck with this problem for more than 6 hours.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sqlite3
a1,a2,a3,a4,a5,a6,a7 = "a","b","c","d","e","f","g"
def save(a1,a2,a3,a4,a5,a6,a7):
conn = sqlite3.connect('5w2h.db')
bd = conn.cursor()
bd.execute("""CREATE TABLE IF NOT EXISTS 5w2h (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
who TEXT,
where TEXT,
when TEXT,
what TEXT,
why TEXT,
how TEXT,
how_much TEXT);""")
bd.execute("""INSERT INTO 5w2h (who, where, when, what, why, how, how_much) VALUES (?,?,?,?,?,?,?);""", (a1,a2,a3,a4,a5,a6,a7))
conn.commit()
conn.close()
save(a1,a2,a3,a4,a5,a6,a7)