I found this from the internet and were trying to apply it to my school project. I tried using while loop but I failed to make it work.
def logs():
mycursor = mydb.cursor()
sql = "SELECT * FROM login_data WHERE BINARY username = '%s' OR BINARY email_address = '%s' AND BINARY password = '%s'" % (
username.get(), username.get(), password.get())
mycursor.execute(sql)
if mycursor.fetchone():
subprocess.Popen([sys.executable, "Manager.py"])
exit()
else:
messagebox.showinfo("Warning", "Wrong username or password")