我搞不定这个棘手问题,进来帮忙下啊
我需要做游戏点卡在线支付,自动弹出卡号和密码的.
点击"在线支付"后,通过了银行的扣款,返回反馈页面,买的卡弹出来了,表中字段used值为0为未出售卡,值1为已经出售卡.
问题:我在出售卡后,1赋值给used,但是结果把表中used=0全部更新为1了,而不是我需要卖出去的卡为1,请帮忙看下吧.我需要的是把卖出去的卡used设为1.
.....
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from card where used=0",conn,1,3
if rs.eof And rs.bof then
response.write "<script language=javascript>alert('此卡缺货');window.close();</script>"
response.end
else
i=0
ii=""
do while not rs.eof
ii=ii&"卡号:"&rs("cardhao")&" "
Response.Write "卡号:"&rs("cardhao")&" "
ii=ii&"密码:"&rs("cardmima")&"<br>"
Response.Write "密码:"&rs("cardmima")&"<br>"
rs("used")=1--------->这里操作之后把表里used都改为1了,而不是我需要的已经出售的卡,该如何做啊?
rs("card_dingdanid")=card_dingdanid
rs.Update
i=i+1
if i>=cardcount then Exit Do
rs.movenext
loop
rs.Close
set rs=nothing
end if