title: Update MySQL database with Python 3
body: <p>I'm trying to insert data from python into a MySQL database I made with phpmyadmin. I'm using Python 3. This doesn't seem to update my database - what's happening here?</p>
  
  <pre><code>import MySQLdb
  
  db = MySQLdb.connect("localhost", "uname", "password", "HORSERACES")
  
  cursor = db.cursor()
  
  sql = """INSERT INTO HORSERACES(Name, Event participant id, Market id, Event name, Event time)
  VALUES('Brimful of Asha', 1099999876, 2098574628, 'Worthing Cup Chase', 29385756568, 2017-05-30 00:00:00)"""
  
  try:
      cursor.execute(sql)
      db.commit()
  except:
      db.rollback()
  
  db.close()
  
  print ('Success')
  </code></pre>
  
  <p>The error I get is:</p>
  
  <p>_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'participant id, Market id, Event name, Event time)\n\tVALUES('Brimful of Asha', 10' at line 1")</p>