Initial commit

This commit is contained in:
2023-12-29 18:31:43 +00:00
commit b09f0ad7bd
24 changed files with 1530 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import sqlite3
user_id = int(input("Enter the user ID of the account: "))
account_type = int(input("Enter an account type to set (1 = customer, 2 = assistant): "))
with sqlite3.connect("../data.db") as connection:
try:
cursor = connection.cursor()
cursor.execute("UPDATE User SET accountType = ? WHERE userID = ?;", [ account_type, user_id ])
if cursor.rowcount == 0:
print("User with given ID was not found in the database. Terminating.")
else:
print(f"User with ID {user_id}'s account type has been successfully updated to {account_type}.")
except sqlite3.Error as error:
print(error)