title: Making a login function using sqlite3
body: <p>I am currently working on a project that requires a login system that can access information (username, password) through a database using sqlite3. Here is the current login system:</p>
  
  <pre><code>def UserLogin():
      un = admin
      pw = password
  
      try:
          statement = cur.execute("SELECT Username FROM Users")
  
          for row in statement:
              if un in row:
                  print("%s" % un)
                  pw_pas = cur.execute("SELECT Password FROM Users WHERE Username = %s" % (un))
  
                  if (pw in pw_pas):
                      print("Welcome\n")
  
                  elif pw not in pw_pas:
                      print("Password is incorrect")
                  return
          print("Username is incorrect")
      except IOError:
          print("This process could not be executed")
  
      print("login successful")
  </code></pre>
  
  <p>The problem is that when I run the code I get an error message saying "sqlite3.OperationalError: no such column: admin". I have entered the username and password into the database but still get this error.</p>
  
  <p>Please help</p>