title: how to fix 'sqlite3.OperationalError: near "?": ' error in python sqlite?
body: <p>i'm using sqlite to organize data fetched with a scraper script, having trouble executing an 'insert into' command.</p>
  
  <p>I'm making a scraper for an electronics website as a newbie Python enthusiast.
  I already had a working script that would scrape all the pages up until when i decided to modify the code to create a new column with prices and name that column using today's date.
  Now for some reason the SQL command that inserts the data to the table refuses to execute with the new column i add.</p>
  
  <p>Tried adding the new column to the SQL command with ? method and .format() method with no success.
  Tried all kinds for ' locations around the ?s and the {}s.</p>
  
  <p>This is the Code:</p>
  
  <pre><code>class Product:
      def __init__(self, prodId, title, price=None):
          self.prodId = prodId
          self.title = title
          self.price = price
          self.currDatePriceCloumnName = date + 'Price'
  
      def insertToTable(self):
          self.addColumn()
          conn = sqlite3.connect(databaseName)
          c = conn.cursor()
          c.execute("insert into {} (?,?,?) values (?,?,?)".format(table),('Product_ID','Title',str(self.currDatePriceCloumnName),str(self.prodId),str(self.title),str(self.price)))
          conn.commit()
          conn.close()
  
      def addColumn(self):
          conn = sqlite3.connect(databaseName)
          c = conn.cursor()
          try:
              c.execute("alter table {} add column '?'".format(table),(str(self.currDatePriceCloumnName),))
              conn.commit()
              conn.close()
          except:
              pass
  
  </code></pre>
  
  <p>i expected the <code>c.execute</code> in the <code>insertToTable</code> to insert the data to the table, but what i get is this error:</p>
  
  <pre><code>  File "/home/sergio/Desktop/test/scraper.py", line 67, in insertToTable
      c.execute("insert into {} (?,?,?) values (?,?,?)".format(table),('Product_ID','Title',str(self.currDatePriceCloumnName),str(self.prodId),str(self.title),str(self.price)))
  sqlite3.OperationalError: near "?": syntax error
  </code></pre>
  
  <p>The weird thing is that the the column is created but not filled.
  When i used the <code>.format()</code> method, the error had the desired column name instead of the ?, this tells me that the issue might be with the fact im using <code>self.currDatePriceCloumnName</code> but i'm stuck from here.</p>
  
  <p>Please help..
  Thanks in advance! =]</p>