There is something with your data. Otherwise your code works for me
import sqlite3 setup_sql = """BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS "Encounters" ( "name" TEXT, "encounters" INTEGER, "PreEnc" INTEGER, "PostEnc" INTEGER ); INSERT INTO "Encounters" ("name","encounters","PreEnc","PostEnc") VALUES ('John Doe',0,20,0); COMMIT;""" sumlst = 12345 user = 'John Doe' conn = sqlite3.connect('Encounters_new.db') c = conn.cursor() c.executescript(setup_sql) for row in c.execute("SELECT * FROM Encounters WHERE name = ?", [user]): print(row) c.execute("UPDATE Encounters SET PostEnc=? WHERE name=?", (sumlst, user)) conn.commit() for row in c.execute("SELECT PostEnc FROM Encounters WHERE name = ?", [user]): print(row) for row in c.execute("SELECT PreEnc FROM Encounters WHERE name = ?", [user]): print(row) for row in c.execute("SELECT * FROM Encounters WHERE name = ?", [user]): print(row)
Output:('John Doe', 0, 20, 0)
(12345,)
(20,)
('John Doe', 0, 20, 12345)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs