title: Insert HTML code into MySQL database using PHP-PDO->Prepare Statement
body: <p>i have a problem, i'm trying to insert html data into my database, but when i insert it, that returns me the quotes with backslash. (i think that is a pdo security function... but how i can to disable it?).</p>
  
  <p>The PHP+PDO code is...</p>
  
  <pre><code>if(!empty($_POST['site_ads_right'])) {
    $update1 = $db-&gt;prepare("UPDATE ads SET custom_html = :html WHERE position = :pos");
    $update1-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
    $update1-&gt;bindValue(':html', $_POST['site_ads_right'], PDO::PARAM_STR);
    $update1-&gt;bindValue(':pos', 4, PDO::PARAM_INT);
    $update1-&gt;execute();
  }
  </code></pre>
  
  <p>And i'm trying to insert this code using a html textarea called site_ads_right for ($_POST)</p>
  
  <pre><code>&lt;a href='http://www.example.com/index.php' target='_BLANK'&gt;&lt;img src='img/content/a46adedac744f8f98b385ed392f92b3d_lll.jpg'&gt;&lt;/a&gt;
  </code></pre>
  
  <p>But when i insert that, the return from database is...</p>
  
  <pre><code>&lt;a href=\'http://www.example.com/index.php\' target=\'_BLANK\'&gt;&lt;img src=\'img/content/a46adedac744f8f98b385ed392f92b3d_lll.jpg\'&gt;&lt;/a&gt;
  </code></pre>
  
  <p>And i need insert it without the filter what puts the backslashes...</p>
  
  <p>Thanks.</p>
  
  <p>Okay, with...</p>
  
  <pre><code>$update1 = $db-&gt;query("UPDATE ads SET custom_html = '".$_POST['site_ads_right']."' WHERE position = 4");
  </code></pre>
  
  <p>Inserts the code without the backslashes.</p>