title: Python not writing to MySQL (Type Error: format requires a mapping)
body: <p>I am using a python programme to log data to a MySQL database.  The database connection is made but I am getting the following error <code>Type Error: format requires a mapping</code> when the log is written.  </p>
  
  <p>The code of interest is as follows:</p>
  
  <p>MySQL Table:</p>
  
  <pre><code>CREATE TABLE pidRun
  (
  pidKey INT auto_increment PRIMARY KEY,
  pidSetPoint INT,
  pidMeasure FLOAT,
  pidError FLOAT,
  integrator FLOAT,
  derivator FLOAT
  );
  </code></pre>
  
  <p>Python Code:</p>
  
  <pre><code># Insert a new line to table pidRun
  add_pidRun = ("INSERT INTO pidRun "
                "(pidSetPoint, pidMeasure, pidError, integrator, derivator)"
                "VALUES (%(pidSetPoint)i, %(pidMeasure)f, %(pidError)f, %(integrator)f, %(derivator)f)")
  </code></pre>
  
  <p>Then the code to insert the line at the requisite point is here:</p>
  
  <p><code>data_pidRun = (pidControl.getPoint(), centSpeed, errSpeed, 0.0, 0.0)
          cursor.execute(add_pidRun, data_pidRun)
          dBase.commit()</code></p>
  
  <p>pidControl.getPoint is a Integer</p>
  
  <p>centSpeed is a float</p>
  
  <p>errspeed is a float</p>
  
  <p>Any direction is really appreciated.</p>