新手写代码,实在完不成了,交叉查询的问题
<%set rs=server.createobject("adodb.recordset")
sql = "select 表1.id,表2.userid from 表1 inner join 表1 on 表1.id = 表2.userid and 表1.paynom =1 and 表2.record like "下线"&UserName&"完成首次支付奖励"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("username") = conn.execute("select UserName from 表1 where id=" & username)(0)
rs("userid") = conn.execute("select Userid from 表1 where id=" & userid)(0)
rs("jifen") = 500
rs("Record") = "下线 "&UserName&" 完成首次支付奖励"
rs("time") = now()
rs.update
rs.close
set rs=nothing
end if
sql = "update 表1 set money = money + " & money & ",jifen = jifen + " & jifen & " where username = '" & username & "'"
conn.execute(sql)
%>
<--当会员在userlist表中的paynom=1并且在jifenlist表中没有Record like为 下线 当前用户 完成首次支付得到奖励,则执行以下操作.-->
请高手帮忙看一下哪里错了