title: Python sqlite3 error about number of bindings supplied
body: <p>I'm sure this has been asked, and answered before, but either I'm stupid or then none of the answers work for me. Maybe I just don't understand it. However, here's the problem; I got this class:</p>
  
  <pre><code>import sqlite3
  
  class User:
     def __init__(self, name, age):
          self.name = name
          self.age = age
  
  
  
     def saveToDatabase(self):
          connection = sqlite3.connect("users.db")
          cur = connection.cursor()
  
          cur.execute("DROP TABLE IF EXISTS users")
          cur.execute("CREATE TABLE users (name TEXT PRIMARY KEY, age INTEGER)")
          cur.execute("INSERT OR REPLACE INTO users VALUES (?,?)", (self.name, self.age))
  
          connection.commit()
          connection.close()
  
      @staticmethod
      def printUserFromDatabase(name):
          connection = sqlite3.connect("users.db")
          cur = connection.cursor()
  
          cur.execute("SELECT * FROM users WHERE name=?", name)
          print(cur.fetchone())
  
          connection.close()
  </code></pre>
  
  <p>And it works, database gets created, and I can add users to it, but when ever I try to print an user from database, this happens:</p>
  
  <pre><code>&gt;&gt;&gt; tom = User("Tom", 24)
  &gt;&gt;&gt; tom.saveToDatabase()
  &gt;&gt;&gt; User.printUserFromDatabase("Tom")
  Traceback (most recent call last):
    File "&lt;pyshell#7&gt;", line 1, in &lt;module&gt;
      User.printUserFromDatabase("Tom")
    File "C:\Users\Markus\Desktop\foo\foo.py", line 25, in printUserFromDatabase
      cur.execute("SELECT * FROM users WHERE name=?", name)
  sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 3 supplied.
  &gt;&gt;&gt; 
  </code></pre>