一个 asp 修改数据库的问题~~
同样是 写入和修改数据库的代码 写入 zhongzhi 数据库的都成功 但是修改 users 数据库的 数据库中amount的值 修改不了 测试了很多次了 修改不了 也没有错误提示! 求知道的朋友帮忙解答~~感激不尽!!!!代码如下:
case "chongzhi"
if trim(request.Form("amount"))<>"" and isnumeric(request.Form("amount")) and trim
(request.Form("alipay_orderno"))<>"" then
payflag=false
set rs=server.CreateObject("adodb.recordset")
sql="select * from chongzhi where alipay_orderno='"&checkstr(request.Form
("alipay_orderno"))&"' and amount="&request.Form("amount")&" and status=3"
rs.open sql,conn,1,3
if not rs.eof then
rs("uid")=LngUserID
rs("status")=1
payamount=rs("amount")
payflag=true
rs.update
end if
rs.close
if payflag then
sql="select * from users where id="&LngUserID
rs.open sql,conn,1,3
if not rs.eof then
rs("amount")=round(rs("amount")+payamount,2)
rs.update
end if
rs.close
else
sql="select * from chongzhi where alipay_orderno='"&checkstr
(request.Form("alipay_orderno"))&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("uid")=LngUserID
rs("alipay_orderno")=request.Form("alipay_orderno")
rs("amount")=request("amount")
rs("addtime")=now()
rs("status")=0
rs("typ")=2
rs.update
else
response.Write "<script>alert('提交失
败。');location.href='chongzhi.asp'</script>"
end if
rs.close
end if
set rs=nothing
response.Write "<script>alert('提交成
功');location.href='czrecord.asp'</script>"
end if