title: Python/MySQL ProgrammingError: 1054 (42S22): Unknown column 'd' in 'field list'
body: <p>my program sends me the following error message after executing the function to insert in the database:</p>
  
  <pre><code>Traceback:
  `Traceback (most recent call last):
    File "C:\Python33\Archive\MySQL-teste12.py", line 275, in &lt;module&gt;
      inserir(cursor, cx2)
    File "C:\Python33\Archive\MySQL-teste12.py", line 193, in inserir
      cursor.execute(add_produto)
    File "C:\Python33\lib\site-packages\mysql\connector\cursor.py", line 415, in execute
      self._handle_result(self._connection.cmd_query(stmt))
    File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 593, in cmd_query
      result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
    File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 515, in _handle_result
      raise errors.get_exception(packet)
  mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'd' in 'field list'`
  </code></pre>
  
  <p>The following table is trying to being inserted:</p>
  
  <pre><code>produto = """
       CREATE TABLE produto (
       prod_nu int(11) NOT NULL AUTO_INCREMENT,
       nome varchar(30) NOT NULL,
       data_lcm date NOT NULL,
       preco int(11) NOT NULL,
       PRIMARY KEY (prod_nu)
       ) ENGINE=InnoDB
       """
  </code></pre>
  
  <p>Here is the procedure where the error occur. I believe it's not accepting any format of date. I've tried many variations, and none of them worked:</p>
  
  <pre><code>def inserir (cursor, db):
      # excess code removed                
      vb = input('Digite a data de Lançamento do Produto (Ano/mês/dia).')
      now = time.strftime('vb')
      …
      add_produto = ("""INSERT INTO produto(nome,
                        data_lcm, preco)
                        VALUES (%s, %s, %s)""" % (va,vb,vc))
  
      cursor.execute(add_produto)
              …
  </code></pre>