如何判断欲注册帐号已经在数据库注册过?

c9394 2001-08-02 11:51:33
如何判断欲注册帐号已经在数据库注册过?
...全文
131 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
c9394 2001-08-04
  • 打赏
  • 举报
回复
谢谢各位。
xdaniel 2001-08-03
  • 打赏
  • 举报
回复
name=request.form("newname")
然后用select判断数据库中是否有帐号=name的
如果rs.eof=true 就是没有注册过
如果rs.eof=false 就是有注册过

viking 2001-08-03
  • 打赏
  • 举报
回复

<%
id=trim(request("id"))
sql="select userid from usertable where userid='"&id&"'"
set rs=conn.execute(sql) 'conn 为数据库连接,这里就不详细写了
if not rs.eof then
response.write "此帐号已经被人注册,请您重新注册新帐号!"
end if
%>
hitwd2000 2001-08-03
  • 打赏
  • 举报
回复
读数据库比较,没有就没注册
luoxxhh 2001-08-03
  • 打赏
  • 举报
回复
username=trim(request("username"))
sql="select * from users where username= '"&username&"'"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
用户名或密码出错!
......

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧