用sql语句写查询语句

来源:百度知道 编辑:UC知道 时间:2024/05/10 10:43:42
注册验证时填写用户名,在数据库里查一下是否用户名已存在
php和mysql,用php写出来。把sql嵌在php里面
高手们可否详细讲解,小妹是初学者!!谢谢各位了!!!

select count(*) from tablename where type=value
set rs=conn.execute(sql)
if rs(0)>0 then
...存在

select count(*) from table_user where username='用户名'
set rs=conn.execute(sql)
if rs(0)>0 then
...存在

select count(*) from table_user where username='用户名'
set rs=conn.execute(sql)
if rs(0)>0 then
...存在

sql=select count(*) from [表名] where user_name='用户名'
set rs=conn.execute(sql)

select userName from tablename where userName=name
set rs=conn.execute(sql)
if rs(rs.next) then
...存在