文章评论提交后出现了问题
问题描述:实现文章评论,可以正常将评论提交到数据库,但是无法在显示页显示,提示语法错误 (操作符丢失) 在查询表达式 'id=' 中。应该是没有更新的缘故,另外:评论接收页是单独页面,评论提交,显示与文章显示在同一页面,单独打开文章显示页面没有问题,但是提交评论后无法显示,提示上述问题。
下面评论接收页代码:
<%
set rsXpl=server.createobject("adodb.recordset")
sql="select wenzhangid,plname,plneirong,plriqi from xinqingyizhanpl"
rsXpl.open sql,connXpl,1,3
rsXpl.addnew
plname=request.form("plname")
plneirong=request.form("plneirong")
plriqi=request.form("plriqi")
id=request.form("id")
wzid=request.form("wenzhangid")
rsXpl("plname")=plname
rsXpl("plneirong")=plneirong
rsXpl("wenzhangid")=wzid
rsXpl.update
rsXpl.close
set rsXpl=nothing
connXpl.close
set rsXpl=nothing
%>文章,评论显示页代码:
<%
Response.Expires = 0
%>
<%
Dim wenzhangid
wenzhangid = Request.QueryString("id")
%>
<%
id = trim(request.querystring("id"))
set rsX=server.createobject("adodb.recordset")
ConnX.Execute ("Update xinqingyizhan Set hits=hits+1 Where id= " & Request("id"))
if id<>"" and isnumeric(id)then
id = clng(id)
else
response.write("非法访问")
response.end
end if
sql="select hits,biaoti,ID,neirong,faburiqi,chuchu from xinqingyizhan where ID=" & wenzhangid
rsX.open sql,connX,1,3
rsX.addnew
%>
<%
dim wzid
wzid=rsX("id")
'response.write(rsX("ID"))
'response.end()
%><%
set rsXpl=server.createobject("adodb.recordset")
sql="select wenzhangid,plname,plriqi,plneirong,plid from xinqingyizhanpl where wenzhangid=" & ID
rsXpl.open sql,connXpl,1,1
if rsXpl.eof or rsxpl.bof then
response.write("暂无")
response.end()
end if
%>