-1
Hello! You can help me?
I’ve tried it in many ways, but I couldn’t understand.
With up to 3 variables this way works, but with 7 variables presents the error in the image below.
I’ve been stuck in this problem for over six 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)
Giovanni Nunes, thank you for your attention and availability in helping. I will test as soon as I am in front of the PC. Thank you.
– Wilson Junior