gpt4 book ai didi

mysql - 传递的值在 CFQUERYPARAM 中被视为空

转载 作者:行者123 更新时间:2023-11-29 07:01:35 25 4
gpt4 key购买 nike

这让我非常困惑,因为我已经这样做了一百次,但现在它让我失望了。

我正在使用 CF 参数进行基本查询更新,而表的主键正在传递一个空值,导致严重失败。

即使我在 #form.id placeholder# 中输入一个硬编码的数字,我也会得到这个:

Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC.

Here is my code base

<cfquery name="updateIdea" datasource="#request.db#">
UPDATE freshideas
SET subject = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.subject#" null="no" />,
content = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.content_text#" />,
postmonth = <cfqueryparam cfsqltype="cf_sql_numeric" value="#form.postmonth#" />,
postyear = <cfqueryparam cfsqltype="cf_sql_numeric" value="#form.postyear#" />,
imglink = <cfqueryparam cfsqltype="cf_sql_varchar" value="#image#" />,
oindex = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.oindex#" null="no" maxlength="3" />
WHERE id = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.id#" null="no" />
</cfquery>

插入工作正常,列 ID 为 auto_increment int(5)。

最佳答案

希望不大,但如果您最近对表进行了更改,则缓存模式可能会出现问题。尝试重新启动您的 CF 服务器,或者甚至只是在您的查询中添加一些空格。这是一篇包含更多信息的帖子。

http://www.coldfusionmuse.com/index.cfm/2005/4/29/dbschemaChange

关于mysql - 传递的值在 CFQUERYPARAM 中被视为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9952640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com