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


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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -