郁闷呀 id为空

lastman001 2003-10-19 11:02:40
news_id=request.QueryString("id")
if request.ServerVariables("REQUEST_METHOD")="POST" then
sort=request.form("sort")
title=request.form("tilte")
content=request.form("content")
content=replace(content,chr(13),"<br>")
sql1="update news set sort='" & sort & "',title='" & title & "',content='" & content & "' where id=" &news_id
response.write sql1
response.end
conn.execute(sql1)
end if
sql="select * from news where id="&id
sql="select sort,title,content from news where id=" & news_id
response.write sql
'response.end
set rs=conn.execute(sql)










update news set sort='1',title='',content='fdfdgg' where id=
...全文
39 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
avonqin 2003-10-19
  • 打赏
  • 举报
回复
晕~~~你更新时没把id的值传过去!!!问题出在更新的表单里
在<form>里加上
<input type=hidden name=id value="<%=news_id%>">

另外:
news_id=request.QueryString("id")改为:news_id=request("id")
lastman001 2003-10-19
  • 打赏
  • 举报
回复
id是自动编号呀
aBoris 2003-10-19
  • 打赏
  • 举报
回复
sql1="update news set sort='" & sort & "',title='" & title & "',content='" & content & "' where id='"&news_id&"'"
lastman001 2003-10-19
  • 打赏
  • 举报
回复
去掉if request.ServerVariables("REQUEST_METHOD")="POST" then...end if
这样可以么
angelheavens 2003-10-19
  • 打赏
  • 举报
回复
去掉if request.ServerVariables("REQUEST_METHOD")="POST" then...end if
lastman001 2003-10-19
  • 打赏
  • 举报
回复
select sort,title,content from news where id=8
update news set sort='2',title='',content='vbvc' where id=
lastman001 2003-10-19
  • 打赏
  • 举报
回复
一进入页面时有值
但是当更新时为空呀
为什么亚
zhljsdly 2003-10-19
  • 打赏
  • 举报
回复
response.write(news_id)
看看有没有值
RadishRabbitGao 2003-10-19
  • 打赏
  • 举报
回复
response.write request.QueryString("id")
看看这个是不是空的
angelheavens 2003-10-19
  • 打赏
  • 举报
回复
把news_id=request.QueryString("id")注释,插入

news_id=request("id")
response.write news_id
response.end
进行测试,不就明白是否传了值过来!!!!?
RadishRabbitGao 2003-10-19
  • 打赏
  • 举报
回复
sql1="update news set sort='" & sort & "',title='" & title & "',content='" & content & "' where id=" &cstr(news_id)
lastman001 2003-10-19
  • 打赏
  • 举报
回复
不行
angelheavens 2003-10-19
  • 打赏
  • 举报
回复
news_id=request("id") 试试
zhljsdly 2003-10-19
  • 打赏
  • 举报
回复

加个隐藏把值传过去

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧