在查询中允许单引号 [英] Allow single quote in query

查看:104
本文介绍了在查询中允许单引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有最后一个问题。它与我关于连续剧的问题更相关,并将其发布在该论坛中,但我们已经关闭它,我认为这是一个简单的问题,如果它需要一个新的论坛让我知道:)。


当我测试插入描述和解决方案时(两个textarea字段)。当我去提交时我注意到了一个问题。如果你输入任何单词,例如:这里的'在这里'它将不会提交它。逗号是它遇到麻烦的原因。我有一个类似于这两个的textarea字段,它没有任何问题,它们除了如何插入之外都有相同的内容。这是我为插入分辨率和描述时所拥有的内容

I got one last question. Its more related to my question about the serials and would post it in that forum but we already closed it an i think its a simple question, if it needs a new forum let me know :).

When i was testing out insertinga description and a resolution (both textarea fields).When i go to submit i noticed a problem.if you put any words like for example: here''s in the field it will not submit it. The comma is what it is having trouble on. An i have a textarea field like these 2 an it has no trouble with it an they have everything the same except how it inserts. This is what i have for when it inserts for both resolution and description

展开 | 选择 | Wrap | 行号

推荐答案

你需要逃避单引号。如果你使用cfqueryparam(阅读它),它会自动为你做。


你也可以通过使用表格结构避免评估语句,例如:
You need to escape the single quotes. If you use cfqueryparam (read up on it), it will do it for you automatically.

You can also avoid the evaluate statements by using the form struct, e.g.
展开 | 选择 | Wrap | 行号


Hey Acoder,


但我对cfqueryparam感到困惑。基本上从在线示例

看起来你把cfqueryparam放在cfquery中是正确的吗?因为我使用2个不同的cfquerys,我会将cfqueryparam放在cfquerys中吗?那么两者的价值是什么?这是我正在看的例子
http:// www.cimmyt.org/CFDOCS/CFML_Reference/Tags79.html


再次感谢你:),

Rach
Hey Acoder,

But i am confused on the cfqueryparam. Basically from the examples online
it looks like you put the cfqueryparam inside the cfquery correct? an since i am using 2 different cfquerys would i put the cfqueryparam in both cfquerys?and then what would the value be for both? here is the example i am looking at
http://www.cimmyt.org/CFDOCS/CFML_Reference/Tags79.html

Thank you again :),
Rach


是的,您应该使用cfqueryparam将所有用户输入到cfquery中,然后将其用于每个字段。


而不是您看过的链接at,从Adobe网站和您的Coldfusion版本获取最新文档。标签有时会随版本而变化。
Yes, you should be using cfqueryparam for all user input into a cfquery and you would use it for each field.

Instead of the link that you''ve looked at, get the latest docs from the Adobe website and for your version of Coldfusion. Tags can sometimes change from version to version.


这篇关于在查询中允许单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆