I am trying to check if a row exist with the same Name my database with python and can\'t quite get it here is what I am trying: (I know the connection is wokring)
cursor.execute("SELECT * FROM userinfo WHERE User_Name=%s",(userid,))
data="error" #initially just assign the value
for i in cursor:
data=i #if cursor has no data then loop will not run and value of data will be 'error'
if data=="error":
print("User Does not exist")
else:
print("User exist")