title: MySQL/Python can't insert dict into database
body: <p>I am currently having troubles inserting into MYSQL DB using python. The execute statement below dosen't run, which I found out using print stmts.</p>
  <p>This is a mystery to me as while using the same codes, my friends are able to insert into their DB (Of course using the appropriate mysql host, password etc. and the same mysql and python version)</p>
  <pre><code>mycursor.execute(&quot;&quot;&quot;
              INSERT INTO emailcontent (Subject, Date, Sender, Sendee, Message_body)
              VALUES (%(Subject)s, %(Date)s, %(Sender)s, %(To)s, %(Message_body)s)
              &quot;&quot;&quot;, temp_dict)
              mydb.commit()
  </code></pre>
  <p>temp_dict example data:</p>
  <pre class="lang-py prettyprint-override"><code>{'Subject': 'Security alert', 'Date': '2020-12-28', 'Sender': 'Google &lt;no-reply@accounts.google.com&gt;', 'Snippet': 'Quickstart was granted access to your Google Account sometestemail@gmail.com If you did not grant access, you should check this activity and secure your account. Check activity You can also see security', 
  'To': 'sometestemail@gmail.com'}
  </code></pre>
  <p>Other codes:</p>
  <pre><code>mydb = mysql.connector.connect(
    host=&quot;localhost&quot;,
    user=&quot;root&quot;,
    password=&quot;root&quot;,
    database=&quot;database&quot;
  )
  
  mycursor = mydb.cursor()
  </code></pre>
  <p>Versions</p>
  <p>Python 3.9.1</p>
  <p>mysql 8.0.22</p>
  <p>mysql-connector 2.2.9</p>