Python Forum
Sqlite 3 Database is not updating after using commit()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sqlite 3 Database is not updating after using commit()
#1
Any help is appreciated.

Table name - Encounters

name   |encounters|PreEnc|PostEnc|
'Name1'|0         |20    |0      |
the values for encounters, PreEnc, PostEnc are default to 0.

Now I want to update the PostEnc with a number.

  import sqlite3

  conn = sqlite3.connect('Encounters.db')
  c = conn.cursor()
   
  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)
sumlst = 12345
user = 'Name'
But PostEnc does not get updated and I get nothing with the print(row)
Reply


Messages In This Thread
Sqlite 3 Database is not updating after using commit() - by JellyCreeper6 - Oct-19-2020, 07:20 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020