mysql - 在 ColdFusion 中更新数据库
问题描述
我有一个 ColdFusion 表单,我想更新我的数据库。我正在使用记录 ID,但是有一个问题。当我输入 url - localhost:8500/elephant_shack/update.cfm?record_id=1 时,我进入了 for,但没有使用表单。我是一个完全新手,迷路了!
任何帮助都会很棒:)
<!--- form--->
<cfquery name="GetRecordtoUpdate" datasource="elephant_shack">
SELECT *
FROM Richard
WHERE record_id = #URL.record_id#
</cfquery>
<table>
<cfoutput query= "GetRecordtoUpdate">
<form action="update_action.cfm" method="Post">
<tr>
<td width="93">record id:</td>
<td width="286"><input name="record_id" type="text" value="#record_id#" size="25"></td>
</tr>
<tr>
<td width="93">Item:</td>
<td width="286"><input name="item" type="text" value="#item#" size="25"></td>
</tr>
<tr>
<td>Stock:</td>
<td><input name="stock" type="text" value="#stock#" size="12"></td>
</tr>
<tr>
<td>Par:</td>
<td><input name="par" type="text" value="#par#" size="12"></td>
</tr>
<tr>
<td>Order:</td>
<td><input name="order" type="text" value="#order#" size="50"></td>
</tr>
<tr>
<td> </td>
<td><input type="Submit" value="Update Information"></td>
</tr>
</form>
</cfoutput>
</table>
此外,数据库未更新。
<!--- update form--->
<cfupdate datasource="elephant_shack" tablename="Richard">
解决方案
推荐阅读
- python-3.x - 如何在 Python Jupyter Notebook 脚本中禁用 %%cython?
- hadoop - 为什么我的数据节点不能在 hadoop-2.8.0 中工作?
- asp.net-core - 在 ASP.NET Core 中验证 OAuth 1.0a 签名的库
- javascript - 使用 Javascript 动态更改 DOM 中的文本
- javascript - 添加并显示表中列总和的结果
- mongodb - docker-compose:我的容器相互连接但不连接到主机
- excel - 如何使用,使用活动 cell.offset 0,-1 并将单词添加到现有值
- angular - 如何使用http拦截器以角度获取响应标头
- regex - 检查没有更多斜杠的正则表达式
- c# - 当我要从我的 c# 代码运行 p4 (Perforce) 命令时,proc.StandardOutput.ReadLine() 返回空字符串