on-internet
← Community

cursor.fetchone() returns None even though a value exists

Stack Overflow ·

I am trying to figure out how to fetch a single value from a UserID and print it in the console. My current piece of code keeps returning "None" even though there is a value for Currency for the UserID I am searching. cursor.execute("SELECT Currency FROM ServerUsers WHERE USERID = %s" % (userid)) if cursor.fetchone(): a = cursor.fetchone() print(a)

Comments

Sign in or sign up to comment and upvote.

No comments yet.