title: How to find rowid of a variable? sqlite3
body: <p>I am making a username password program using sqlite and I want to check if a username is in the database (I've already done this) then I want to find the row id of said username. This will be a username that the user has input. I know how to find the rowid of a word in the database e.g 'Word'. How would I make is so I could replace the word with a variable?</p>
  <pre><code>def sign_in():
      usernameask = input(&quot;What is your username?&quot;)
      passwordask = input(&quot;What is your password?&quot;)
      c.execute(&quot;SELECT username FROM stuffToPlot&quot;)
      names = {name[0] for name in c.fetchall()} 
      if usernameask in names:
          print(&quot;Yes&quot;)
          c.execute(&quot;SELECT password FROM stuffToPlot&quot;)
          passs = {name[0] for name in c.fetchall()}
          if passwordask in passs:
              print(&quot;yes,pass&quot;)
              t = c.execute(&quot;SELECT rowid, FROM stuffToPlot WHERE username = 'usernameask' &quot;)
              rowid = t.fetchall()
              for r in rowid:
                  print(r)
          else:
              print(&quot;No,pass&quot;
  </code></pre>
  <p>I am looking at where it says <code>t = c.execute(&quot;SELECT rowid, FROM stuffToPlot WHERE username = 'usernameask' &quot;)</code>
  and want to replace the <code>'usernameask'</code> which is currently looking for it as a word in the database to a variable. How would I do this?
  There is no error, it just finds the position of the word &quot;usernameask&quot; which isn't in the database.</p>