title: Save file_get_contents in database
body: <p>I want to save 10.000 pages in my site's database.</p>
  
  <p>When I run the file, this error occurs for every page.</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near '_trackPageLoadTime']);(function() {var ga =
    document.createElement("script"); ga' at line 1</p>
  </blockquote>
  
  <p>I think there are some characters that are causing the error.</p>
  
  <p>savedb.php</p>
  
  <pre><code>&lt;?php 
  include "conexao.php";
  
  for ($nr=1; $nr&lt;=10000; $nr++){
      $url = "http://www.site.com/u$nr";
      $html = file_get_contents($url);
  
      set_time_limit(120);
  
      $tabela_bd = "paginas";
  
      $sql = mysql_query("INSERT INTO $tabela_bd(html) VALUES('$html')");
      if ($sql) {echo "Cadastrado com sucesso!!";
  } else {
  echo "Falha ao cadastrar.".mysql_error();
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>@edit
  Solved my problem with characters, but now some tables are being saved without content.</p>