关于数据库判断问题
如何来判断数据库大表 XING_CLASS 里面的字段 CF QQ 是否有名字 如果有就让注册如果没有就不让注册啊。
CF=trim(request.Form("xing_class"))
QQ=trim(request.Form("xing_qq"))
username=request.form("xing_name")
set res=server.CreateObject("adodb.recordset")
sql="select * from [XING_CLASS] where xing_cf="&CF&" and xing_cfqq="&QQ&""
set res=conn.execute (sql)
if not res.eof then
else
Response.Write("<script>alert('〖"&xingmc&"〗里面没有你这个名字或你的QQ不正确');javascript:history.back();</script>")
end If
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [XING_USEA] where xing_name='"&username&"'",conn,1,3
if not rs.eof and not rs.bof then
Response.Write("<script>alert('这个帐号已经被别人使用了');javascript:history.back();</script>")
Response.End
end if
rs.addnew
rs("xing_name")=trim(request.Form("xing_name"))
rs("xing_class")=trim(request.Form("xing_class"))
rs("xing_pss")=MD5(trim(replace(request("xing_pss"),"'","")))
rs("xing_wt")=trim(request.Form("xing_wt"))
rs("xing_da")=MD5(trim(replace(request("xing_da"),"'","")))
rs("xing_qq")=trim(request.Form("xing_qq"))
rs("xing_sex")=trim(request.Form("xing_sex"))
rs("xing_gx")=trim(request.Form("xing_gx"))
rs("xing_ip")=Request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
Response.Write "<script>alert('欢迎成为本站会员,您的用户名为〖"&username&"〗!');location.href='index.asp';</script>"
Response.End
set rs=Nothing