title: Python 3 SQLite3 - Incorrect number of bindings
body: <p>I understand there are MANY questions on Stack Overflow about this error but I have tried MANY solutions and obviously they have all failed.</p>
  
  <p>Here's a list:</p>
  
  <p><a href="https://stackoverflow.com/questions/16856647/sqlite3-programmingerror-incorrect-number-of-bindings-supplied-the-current-sta">sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied</a></p>
  
  <p><a href="https://stackoverflow.com/questions/228912/sqlite-parameter-substitution-problem">SQLite parameter substitution problem</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19473281/sqlite3-programmingerror-incorrect-number-of-bindings-supplied">sqlite3.ProgrammingError: Incorrect number of bindings supplied</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9986578/reading-from-database-with-sqlite-and-python-incorrect-number-of-binding-suppli">Reading from database with SQLite and Python: Incorrect number of binding supplied</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4654513/sqlite-python-insert-incorrect-number-of-bindings-supplied">SQLite Python Insert - Incorrect Number of Bindings Supplied</a></p>
  
  <p>I am trying to store a username and hashed password (created by PassLib - <a href="https://pythonhosted.org/passlib/" rel="nofollow noreferrer">https://pythonhosted.org/passlib/</a> ) in a SQLite3 database. These are stored in the variables "targetusername" and "password" respectively. My problem is that when I actually try to insert these 2 variables into a table of a database called "Passwords", it gives this error:</p>
  
  <pre><code>Incorrect number of bindings supplied. The current statement uses 1, and there are 11 supplied.
  </code></pre>
  
  <p>Here's an example of what targetusername and password would store:</p>
  
  <pre><code>targetusername = "user4884072"
  password = "$5$rounds=535000$ySH31paWMjEDCUUY$jdrBVGsoYnSMkdVBtjCaxQy2f0g3MX1Wts4vSYz7m.4"
  </code></pre>
  
  <p>This line gives the error:</p>
  
  <pre><code>c.executemany("INSERT INTO {tn} ({idf}, {cn}) VALUES(targetusername, %s" % str(password).\
  format(tn="Passwords"))
  </code></pre>
  
  <p>It has been changed multiple times to try and fix the issue (which apparently is caused by how Python stores variables), but here is what it was originally:</p>
  
  <pre><code>c.execute("INSERT OR IGNORE INTO {tn} ({idf}, {cn}) VALUES (targetusername, password)".\
  format(tn="Passwords", idf="Username", cn="Password"))
  </code></pre>