Skip to content

Commit 1138acd

Browse files
committed
DB tutorial updates - make SQLite example
1 parent 6151b94 commit 1138acd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sqlite3
2+
3+
db_file = "new.db"
4+
5+
connection = sqlite3.connect(db_file)

4 DB in Python/SQLite Demo/vinventory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def update_data():
9696
#update the change made date log
9797
sql = "UPDATE vaccines set changemade = ? where id = ?"
9898
changemade = str(now.year) +"/"+str(now.month) +"/"+str(now.day)
99-
conn.execute(sql, (changemade,update_ID))
99+
conn.execute(sql, (changemade,update_ID))
100+
conn.commit()
100101

101102
except Error as e:
102103
print(e)

0 commit comments

Comments
 (0)