Have tried with both (?) and (%s) but doesn't seem to be working. Where am I gong wrong?
def update(phone,name):
conn = sqlite3.connect(db)
print ("\nOpened database for updates successfully")
sql = "UPDATE VARUN set PHONE = %s where NAME= %s "
print (sql)
conn.execute(sql,(phone,name))
'''
conn.execute("UPDATE VARUN set PHONE = (?) where NAME= (?) ",(phone,name));
'''
conn.commit()
----- calling function ----
contactlist[selection()]=[nameVar.get(), phoneVar.get()]
updt = (contactlist[selection()])
name = (updt[0])
phone = (updt[1])
print (name,phone)
try:
update(name,phone)
except:
tkinter.messagebox.showwarning("cannot be blank")
else:
setList ()
saveContact()