title: A check if username exist in database with Python
body: <p>I'm trying to make a small project with python since I just started learning that.
  I'm using MySQL, and I have 3 tables inside my database, ID, username and password.
  I'm trying to get from stdin a username and password and check if they already exist inside my database.
  What I tried so far is :</p>
  
  <pre><code>def login():
    mycursor = mydb.cursor()
    print('Enter username: ')
    username = input()
    checkUsername = mycursor.execute('SELECT username FROM users WHERE username=?', (username))
    if checkUsername != 0:
      print('Username is not exist')
    else:
      print('Logged In!')
  </code></pre>
  
  <p>but I'm getting an error which says </p>
  
  <pre><code>You have an error in your SQL syntax; check the manual that corresponds
  to your MySQL server version for the right syntax to use near '?' at line 1
  </code></pre>
  
  <p>Thanks.</p>