title: Why is my .fetchone function returning "none"?
body: <p>Username is a variable that is drawn from an Entrybox using tkinter. I need for dbsalt to return the outcome of the cursor1.execute query as a string, but it returns "none" or presents a traceback that states "NoneType has no attribute <strong>getitem</strong>". I do not understand what is incorrect. </p>
  
  <pre><code>def login_verification(self):
  
      sql = ("SELECT salt FROM User WHERE username = %s")
      username = self.KUEntry.get()
      print username
      cursor1.execute(sql, username)
      dbsalt = cursor1.fetchone() [0]
      print dbsalt
  
      sql2 = ("SELECT PashHash FROM User WHERE username = %s")
      cursor2.execute(sql2, username)
      dbhash = cursor2.fetchone() [0]
      print dbhash
  
      test = hashlib.sha512(username + dbsalt).hexdigest()
      print test
  
      if test == dbhash:
          self.intro_screen
      else:
          print "incorrect password"
  </code></pre>