Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 CF 查询在我的数据库中插入以下字符串:Aman#30 is "OK"
Aman#30 is "OK"
但我收到错误“无效的构造:缺少参数或名称。”
在进一步调查中,我发现只有当我在字符串中使用 # 或 " 时才会发生这种情况。
有关如何解决此问题的任何建议?
您很可能需要避开井号和引号。例如:
<CFSET yourstring = "Aman##30 is ""OK""" /> <CFQUERY result="qRes" datasource="#yourDSN#"> INSERT INTO `yourtable` (`yourstringfield`) VALUES (<CFQUERYPARAM value="#yourstring#" cfsqltype="cf_sql_varchar" />) </CFQUERY>