如何判断ASP数据库里面内容是否存在
其中uid和datetime两个字段作为判断如果存在则不能执行下边操作。这个是SEVE页面。希望高人讲解下<%ifrequest.querystring("action"...
其中uid 和 datetime两个字段作为判断如果存在则不能执行下边操作。
这个是SEVE页面。希望高人讲解下
<% if request.querystring("action")="dh" then
conn.execute("Insert Into mc_paidui (cart,uid,uniacid,sh,datetime) values ('"&trim(request.form("cart"))&"',"&server.HTMLEncode(trim(request.form("uid")))&","&server.HTMLEncode(trim(request.form("uniacid")))&","&server.HTMLEncode(trim(request.form("sh")))&",'"&trim(request.form("datetime"))&"')")
set rs=server.createobject("adodb.recordset")
sql="select * from ims_mc_members where uid="&request.form("uid")&" "
rs.open sql,conn,1,3
rs("credit1")=trim(request.form("credit1"))
rs.update
response.Write "<script language=javascript>alert('兑换成功!');window.location.href='"&request.serverVariables("HTTP_REFERER")&"';</script>"
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%> 展开
这个是SEVE页面。希望高人讲解下
<% if request.querystring("action")="dh" then
conn.execute("Insert Into mc_paidui (cart,uid,uniacid,sh,datetime) values ('"&trim(request.form("cart"))&"',"&server.HTMLEncode(trim(request.form("uid")))&","&server.HTMLEncode(trim(request.form("uniacid")))&","&server.HTMLEncode(trim(request.form("sh")))&",'"&trim(request.form("datetime"))&"')")
set rs=server.createobject("adodb.recordset")
sql="select * from ims_mc_members where uid="&request.form("uid")&" "
rs.open sql,conn,1,3
rs("credit1")=trim(request.form("credit1"))
rs.update
response.Write "<script language=javascript>alert('兑换成功!');window.location.href='"&request.serverVariables("HTTP_REFERER")&"';</script>"
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%> 展开
1个回答
展开全部
<%
if request.querystring("action")="dh" then
set rs=server.createobject("adodb.recordset")
sql="select * from mc_paidui where uid="&server.HTMLEncode(trim(request.form("uid")))&" and datetime='"&request.form("datetime")&"'"
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("cart")=trim(request.form("cart"))
rs("uid")=server.HTMLEncode(trim(request.form("uid")))
rs("uniacid")=server.HTMLEncode(trim(request.form("uniacid")))
rs("sh")=server.HTMLEncode(trim(request.form("sh")))
rs("datetime")=trim(request.form("datetime"))
rs.update
rs.close
sql="select * from ims_mc_members where uid="&request.form("uid")
rs.open sql,conn,1,3
rs("credit1")=trim(request.form("credit1"))
rs.update
response.Write "<script language=javascript>alert('兑换成功!');window.location.href='"&request.serverVariables("HTTP_REFERER")&"';</script>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询