#๐Ÿ”’ data base login not working

13 messages ยท Page 1 of 1 (latest)

marble vaultBOT
#

@finite ivy

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

finite ivy
vernal crest
#

What's not wroking (except the INSERT statement missing some , commas after the values)?

#

Hint: Saving passwords in plaintext is not secure.

finite ivy
#

and it was suppose to login into a profile window when the right combination of values were put in but it shows invalid username or password

finite ivy
vernal crest
#

Your program works for me:

#

Maybe yout db-file is not in the same folder as where you execute the program?

#

Be aware that this line:

db = sqlite3.connect('user_db.db')

will create the file in the current working directory as an empty database.

#

Although, you don't get an exception which means there is an users table in the database.
Hm, maybe display the content of the whole users table in the login function to check.

#

Add:

print(db.execute("SELECT * FROM users").fetchall())

at line 26 to check it.

marble vaultBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.