title: How to print the query being sent to mySQL using 'pymysql'?
body: <p>Let's say I have the following code:</p>
  
  <pre><code>with open('saved_response.json') as data_file: 
      #data_ordered = json.load(data_file, object_pairs_hook=OrderedDict)
      response=json.load(data_file)
  
  for user_data in response['itemList']:
      field_names=""
      field_values=[]
      for i in user_data:
          field_names+=","+i
          field_values.append(user_data[i])
      print(field_names[1:])
      print(field_values)
      with con.cursor() as c:
          c.execute("INSERT into user(%s) values(%s);",(field_names[1:],field_values))
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>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 ''id,parentId,username,creationTime,role,state,userProfile') values((562949953421' at line 1")
  </code></pre>
  
  <p>Is there any way to print the SQL query being sent to MySQL for execution so that we can resolve syntax errors like this? 
  Also, a solution to this error will be appreciated.</p>