大家谁可以帮我看一下这段代码那里错了啊~
这是一段二级分类商品添加修改的代码,其中添加功能"add"可以实现,但是修改功能"edit"却不能实现,哪位大虾可以帮我看看是哪里出错了啊~小弟先再这里谢谢了~<!--#include file="conn.asp"-->
<%
if request("bookname")="" or request("shichangjia")="" then
response.Write "对不起,添加失败,请用正确的方式添加商品!"
response.End
end if
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function
dim bookdate,dazhe
dim action,bookid
bookid=request.QueryString("id")
action=request.QueryString("action")
shjianame=request.cookies("kkyyorg")("shjianame")
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from products",conn,1,3
rs.AddNew
rs("mch")=trim(request("mch"))
rs("pp")=trim(request("pp"))
rs("isbn1")=trim(request("isbn1"))
rs("jj")=trim(request("jj"))
rs("jg")=trim(request("jg"))
rs("zl")=trim(request("zl"))
rs("tp")=trim(request("tp"))
rs("nr")=trim(request("nr"))
rs("bh")=trim(request("bh"))
rs("anclassid")=int(request("anclassid"))
rs("nclassid")=int(request("nclassid"))
rs("bookname")=trim(request("bookname"))
rs("isbn")=trim(request("isbn"))
rs("bookchuban")=trim(request("bookchuban"))
rs("shichangjia")=trim(request("shichangjia"))
rs("bookpic")=trim(request("bookpic"))
rs("zhuang")=trim(request("zhuang"))
rs("bookcontent")=htmlencode2(trim(request("bookcontent")))
if request("bestbook")=1 then
rs("bestbook")=1
else
rs("bestbook")=0
end if
if request("newsbook")=1 then
rs("newsbook")=1
else
rs("newsbook")=0
end if
if request("tejiabook")=1 then
rs("tejiabook")=1
else
rs("tejiabook")=0
end if
rs("chengjiaocount")=0
rs("liulancount")=0
rs("adddate")=now()
rs("pingji")=0
rs("pingjizong")=0
rs.Update
bookid=rs("bookid")
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('添加成功!');history.go(-2);</script>"
response.End
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from products where bookid="&request.QueryString("id"),conn,1,3
rs("anclassid")=int(request("anclassid"))
rs("nclassid")=int(request("nclassid"))
rs("bookname")=trim(request("bookname"))
rs("shichangjia")=trim(request("shichangjia"))
rs("bookpic")=trim(request("bookpic"))
rs("zhuang")=trim(request("zhuang"))
rs("bookcontent")=trim(request("bookcontent"))
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');history.go(-2);</script>"
response.End
end select
%>