I have a problem with some code I wrote:
def login(username, password):
c.execute("SELECT * FROM masterPasswords WHERE passw='{}' AND user='{}'".format(password, username))
if passw == password and user == username:
return True
else:
return False
This is the error log:
Traceback (most recent call last):
File "C:/Users/fraze/Documents/GitHub/Password-Management/main.py", line 65, in <module>
account()
File "C:/Users/fraze/Documents/GitHub/Password-Management/main.py", line 28, in account
tryLogin()
File "C:/Users/fraze/Documents/GitHub/Password-Management/main.py", line 15, in tryLogin
if am.login(usernameInput, masterPassInput) == usernameInput and masterPassInput:
File "C:\Users\fraze\Documents\GitHub\Password-Management\accountManagement.py", line 19, in login
c.execute("SELECT * FROM masterPasswords WHERE passw='{}' AND user='{}'".format(password, username))
sqlite3.OperationalError: no such column: passw
I need some help please...
c.execute("SELECT * FROM masterPasswords WHERE passw=? AND user=?", (password, username))to parameterize it. But I don't know whether that will work because it's possible that you didn't build and table with a column calledpassw.passwcolumn. What is the question here?