title: How to insert html code in mysql database?
body: <p>I have copies text from many html files into one text file/variable  and I wants to insert this data(basically html code) into mysql database. I have tried mysql_real_escape_string. But it is still no working. This is what I am doing :</p>
  
  <pre><code>$contentFromHtmlFile=file_get_contents($file);  
  $all_html_content.=$contentFromHtmlFile; 
  $all_html_content=mysql_real_escape_string($all_html_content);  
  $insert_query = "insert into $databasetable (pdf_id,pdf_text_data) values (190,$all_html_content);";
  
  mysql_query($insert_query) or die(mysql_error());
  </code></pre>
  
  <p>This is the error :</p>
  
  <pre><code>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 '&lt;meta charset=\&amp;quot;utf-8\&amp;quot; /&gt;\n\n&lt;div id=\&amp;quot;jpedal\&amp;quot; style=\&amp;quo' at line 1
  </code></pre>
  
  <p>Here link of text I wants to insert: <a href="http://pastebin.com/F3BD745h" rel="nofollow">http://pastebin.com/F3BD745h</a></p>