我想插入一个字符串到MySQL数据库 - 它包含正则表达式包含引号,星号,反斜杠等 - 以下不工作 - 任何想法如何纠正它?根据其他答案,我也尝试过没有快乐的特质。神秘的错误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')
使用参数向数据库中插入值。 –
您使用哪种客户端语言? –