python - sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2754 supplied -
this question has answer here:
table
c.execute("create table project ( id integer primary key autoincrement, content text, postdate timestamp not null default current_timestamp) ") te = "testing" c.execute("insert project (content) values (?)", (te))
error
sqlite3.programmingerror: incorrect number of bindings supplied. current statement uses 1, , there 7 supplied.
try change into:
c.execute("insert project (content) values (?)", (te,))
(with comma after te). because (te)
without comma not tuple, , have pass parameters in tuple. if have 1 element, have tell python tuple inserting final comma.
Comments
Post a Comment