title: Insert into mysql using dictionary
body: <p>I want to do the following SQL statement:</p>
  
  <pre><code>INSERT INTO myTable (name, year) VALUES ("David", 2016)
  </code></pre>
  
  <p>Is there a simple way to do the above <code>INSERT</code> using a dictionary:</p>
  
  <pre><code>d = {
    "name": "David",
    "year": 2016
  }
  </code></pre>
  
  <p>Perhaps something like:</p>
  
  <pre><code>cursor.execute('INSERT INTO myTable (%s) VALUES (%s)', (d.keys(), d.values())
  </code></pre>
  
  <p>Or even:</p>
  
  <pre><code>cursor.execute('INSERT INTO myTable %s', (d.items(),))
  </code></pre>