title: Python, SQLite: Apostrophe in '%s'
body: <p>I'm getting a syntax error when trying to execute SQLite3 query. The problem is because variable inputPattern contains 's.</p>
  
  <p>The function is:</p>
  
  <pre><code>def searchForExactEnglishToCzechTranslation(inputPattern,db):
      if "\'" in inputPattern:
          inputPattern.replace("'","''")
      result = db.execute("SELECT czech FROM translations WHERE english='%s'"  % (inputPattern)).fetchall()
  </code></pre>
  
  <p>I'm trying to replace the sign ' but still isn't working. </p>
  
  <p>Will you give me an advice? Thanks</p>