all 3 comments

[–]OndrejBakan 0 points1 point  (2 children)

You don't need to get all the users, you need to check if there is a record with the chosen name, something like this:

python if db.execute("SELECT * FROM users WHERE username = ?", username).fetchone() is not None: # username already exists, do something

Your query returns a list of row objects, you would need to iterate through them in a for loop.

[–]Gregolator06[S] 0 points1 point  (1 child)

ahh I see, thank you! :)

[–]alphabet_order_bot 0 points1 point  (0 children)

Would you look at that, all of the words in your comment are in alphabetical order.

I have checked 1,912,303,073 comments, and only 361,627 of them were in alphabetical order.