title: Escape quotes in MySQL query on python
body: <p>I am trying solve problem with quotes in my sql queries. I know that many questions were asked on stackoverflow. But no one worked for me. May be because I am using other framework (<a href="https://github.com/PyMySQL/PyMySQL/" rel="nofollow noreferrer">pyMySQL</a>) for sql connection. I tried parameterized mysql query:</p>
  
  <pre><code>    conn = pymysql.connect(host ='host', user='user', passwd='user', db='db', charset='utf8mb4')
      cur = conn.cursor()
      cur.execute("USE db")
      cur.execute("UPDATE table SET callback_data = %s, message = %s, photo = %s, location = %s, first_name_last_name = %s WHERE user_id=%s",
  (callback_data, message, photo, location, first_name_last_name, user_id))
      cur.connection.commit()
      cur.close()
      conn.close()
  </code></pre>
  
  <p>But I always get error with %s (error message:  expected, got %s). My python version is 3.6.1. How I can escape quotes in my sql query? Thanks. </p>