MySQLデータベースに文字列を挿入しようとしています - 引用符、アスタリスク、バックスラッシュなどを含む正規表現が含まれています - 以下は動作しません。私はまた、他の答えに基づいて喜んでhtmlentitiesを試してみました。不思議なエラー1064
qa_db_query_sub('INSERT INTO `^islamiqa_topics` (title, description, regexp) VALUES ($, $, $)', $title, $description, mysql_real_escape_string($regexp));
これは私が取得エラーです:
Database query error 1064
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 'regexp)
VALUES ('7/7', '3rd of March 1924 was the day the Ottoman' at line 1
INSERT INTO `qa_islamiqa_topics` (title, description, regexp) VALUES ('7/7', '3rd of March 1924 was the day the Ottoman Caliphate was formally abolished in Turkey by Mustafa Kemal Atataurk.', '7/7(/2005)?|7(th)? july 2005|july 7.* 2005')
データベースに値を挿入するためにパラメータを使用します。 –
どのクライアント言語を使用していますか? –