Sorry if this question seems convoluted or is easilt googlable, I was struggling to find anything particularly helpful. Essentially, at the beginning of my python program I have a login which checks the database to see if the username and password match:
existingAccount = input("Do you already have an account? (y/n)")
if existingAccount == "y":
username = input("Please enter your username: ")
password = input("Please enter your password:")
find_user = ("SELECT * FROM Users WHERE Username = ? AND Password = ?")
c.execute(find_user, [(username), (password)])
results = c.fetchall()
This creates the variable results which I want to use as a way of checking the active user for creating an order and checking their permission level which is stored in the Users table.
I am going to write a function which will allow someone to add a new product to the products table but i only want users with the permission level admin to be able to do it.
Is there a way I can do some sort of if statement using the results variable to say "if results contains userPermissionLevel Admin then continue, if not print "permission level inadequate"
Thanks and sorry again if this is an easy question.