title: mysql escaping single and double quotes
body: <p>I have a script that i am writing to move certain fields to a new db like </p>
  
  <pre><code>$results = mysql_query ( "SELECT body, title  FROM $source_db.Post" );
  while ($row = mysql_fetch_array($results)) {
  if(mysql_num_rows($users_result) &gt; 0){
      $insert = "INSERT INTO wp_posts (`body`,`title`) VALUES ('{$row['body']}', '{$row['row']}')";
      mysql_query($insert);
      }
  }
  </code></pre>
  
  <p>but as you can see the query will break everytime due to the single and double quotes, is there a solution to this problem like herdok or something</p>
  
  <pre><code>INSERT INTO wp_posts (`body`,`title`)
              VALUES
                  ('Here are the final returns from today's ...&lt;br /&gt;&lt;br /&gt;he stayed home...&lt;br /&gt;
  &lt;div class="entry-content"&gt;
  &lt;div class="entry-body"&gt;', 'something')
  </code></pre>