Quote:
What could cause this error?
Indentation in Python is significant: it controls what is and isn't in a block of code.
All the contiguous code indented by the same amount (or more) is part of teh same code block:
while foo == bar:
Part of loop
if (foo + bar == foobar:
Still part of loop
Not part of loop -0 executed once the loop exits.
So your code:
for self.fila in self.data2:
self.v_email = self.fila[0]
self.v_password = self.fila[1]
self.cursor2.close()
Only contains two lines inside the loop, and will always leave the same value in the email and password fields - the last one read from the DB.
Subsequent code will never get a chance to look at the other users data.
You need to think about exactly what you are doing here, and do some more processing inside your loop to decide which row to exit on.
Additionally, you should never store passwords in clear text - it is a major security risk. There is some information on how to do it here:
Password Storage: How to do it.[
^] -= it's C# based, but Python has similar methods.
And remember: if you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.