注册 登录
编程论坛 ASP技术论坛

我看不明白

uj8yh 发布于 2007-08-20 22:03, 405 次点击

<label>
<input name="5" type="text" id="5" size="10">
</label>

下面这个代码我看不明白这个是提出不?
<%
if request("5")="go" then
response.Write(eval(request("textfield")))
end if
%>

怎么改这下面的textfield 才运算啊
<%conn.execute ("update kucun set 数量=数量 - textfield where kucun.编号=1001")%>

1 回复
#2
multiple19022007-08-20 22:37
按照你现在的代码 "textfield"作为字符串参加运算,就像“李明的身高+王超的身高”算出来是“李明的身高王超的身高”而不是300cm


这也不算技巧了

"update kucun set shuliang=shuliang-" & request("textfield") & "where 1=1"

另外 <%conn.execute ("update kucun set 数量=数量 - textfield where kucun.编号=1001")%>

这行貌似语法有错 去掉小括号
1