asp中修改ID为1的内容,请问以下内容哪里有问题?
表:live字段:IDadd1http显示页:<inputtype="text"name="add"value="<%=rslive("add")%>"><inputna...
表:live
字段: ID add
1 http
显示页: <input type="text" name="add" value="<%=rslive("add")%>">
<input name="ID" type="hidden" value="<%=rslive("ID")%>">
//此内容能显示 提交无误
<%
Set rslive = Server.CreateObject("ADODB.Recordset")
sql = "update live set address = '"&Trim(Request.Form("address"))&"' where ID= "&Trim(Request.Form("ID"))
con.execute sql
response.write "<script language='javascript'>"
response.write "alert('修改成功');"
response.write "location.href='default.asp';"
response.write "</script>"
response.end
%>
if Trim(Request.Form("address"))<>"" then
sql = "update live set address = '"&Trim(Request.Form("address"))&"' where ID= "&Trim(Request.Form("ID"))
con.execute(sql)
response.write "<script language='javascript'>"
response.write "alert('修改成功');"
response.write "location.href='default.asp';"
response.write "</script>"
response.end
end if
//提交跳转了,没有修改内容........ 展开
字段: ID add
1 http
显示页: <input type="text" name="add" value="<%=rslive("add")%>">
<input name="ID" type="hidden" value="<%=rslive("ID")%>">
//此内容能显示 提交无误
<%
Set rslive = Server.CreateObject("ADODB.Recordset")
sql = "update live set address = '"&Trim(Request.Form("address"))&"' where ID= "&Trim(Request.Form("ID"))
con.execute sql
response.write "<script language='javascript'>"
response.write "alert('修改成功');"
response.write "location.href='default.asp';"
response.write "</script>"
response.end
%>
if Trim(Request.Form("address"))<>"" then
sql = "update live set address = '"&Trim(Request.Form("address"))&"' where ID= "&Trim(Request.Form("ID"))
con.execute(sql)
response.write "<script language='javascript'>"
response.write "alert('修改成功');"
response.write "location.href='default.asp';"
response.write "</script>"
response.end
end if
//提交跳转了,没有修改内容........ 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询