多くの html ファイルからテキストを 1 つのテキスト ファイル/変数にコピーしており、このデータ (基本的には html コード) を mysql データベースに挿入したいと考えています。mysql_real_escape_string を試しました。しかし、それはまだ機能していません。これは私がやっていることです:
$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());
これはエラーです:
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 '<meta charset=\"utf-8\" />\n\n<div id=\"jpedal\" style=\&quo' at line 1
ここに挿入したいテキストのリンク: http://pastebin.com/F3BD745h