Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

Selecting a row from a MySQL table which matches a touple specified in Python

$
0
0

I am actually a student trying to build a login/registration functionality within my project. I'm receiving errors in fetching an entire row from mysql which matches the tuple of input-based variables specified in Python and am unsure how to proceed.

In detail: so my intent is to take input from the user in the form of a username and a password and then match it to preexisting rows in a table in MySQL. but my code does not seem to work.

Here is the code:

cursor.execute("SELECT * FROM user WHERE username, password LIKE '%s','%s'"%(username,password))ecreds = cursor.fetchall()if len(ecreds) == 1:print("Login successful. Welcome, ")

Can anyone tell me where I'm going wrong? Any advice is appreciated, thanks.

Can anyone tell me where I'm going wrong? Any advice is appreciated, thanks.


Viewing all articles
Browse latest Browse all 11661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>