title: Warning: PDOStatement::execute(): message: Unclosed quotation mark after the character string
body: <p>How do I sanitize the data so it won't cause any errors? I'm running ubuntu, php 5.3 and connecting to mssql.</p>
  
  <p>This is my code:</p>
  
  <pre><code>            $body = $this-&gt;get_part($imap, $b, "TEXT/HTML");
              if($body == "")
              {
                  $body = $this-&gt;get_part($imap, $b, "TEXT/PLAIN");
              }
              $header = imap_headerinfo($imap, $b);
              $subject = $header-&gt;subject;
              $fromaddress = $header-&gt;fromaddress;
              $body = str_replace("'", "''", $body);
              //$body = str_replace("\"", "\"\"", $body);
              /////////////////////////////
              $data = array('content'=&gt;$body);
              $query = $PDO-&gt;prepare('insert into [tbl_test] (content) values (:content)');
              $query-&gt;execute($data);
              break;
  </code></pre>