title: How to INSERT string with single quote ' symbol
body: <p>I want to do an INSERT into a MySQL database using:</p>
  
  <pre><code>$sql = "INSERT INTO table (title1) VALUES ('$myVar')";
  </code></pre>
  
  <p>but the problem is <code>$myVar</code> can contain the single quotes (<code>'</code> symbols, e.g. in "idiot's"). Can somebody tell me how to handle any single quotes in the variable as a letter and not as a piece of code?</p>
  
  <p>(I know there are posts about this in the forum already, but I do not really understand their solutions, so sorry for double posting)</p>