python sqlite3 UPDATE set from variables -


i made next query update row in db.

def savedata(title, ll, lr, rl, rr, distanceback):     c.execute("update settings set (?,?,?,?,?,?) name=?",(title, ll, lr, rl, rr, distanceback, title))     conn.commit() 

i next error: sqlite3.operationalerror: near "(": syntax error know isn't correct question marks. can't find out exact solution is. can explain me problem is?

you use sql syntax:

update table_name set column1 = value1, column2 = value2...., columnn = valuen [condition]; 

for example, if have table called category , want edit category name can use:

c.execute("update category set name=? id=?", (name,category_id)) 

where:

category table contains 2 items: (id, name) id primary key.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -