mirror of
https://github.com/0xShay/SupportMe.git
synced 2026-01-11 13:23:24 +00:00
Initial commit
This commit is contained in:
17
tools/changeAccountType.py
Normal file
17
tools/changeAccountType.py
Normal 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)
|
||||
Reference in New Issue
Block a user