为什么注册的用户账号长度不能超过5个字符

来源:百度知道 编辑:UC知道 时间:2024/05/31 00:12:21
注册程序如下,IIS6.0 2K3 数据库是 MYSQL ODBC是最新版
当新用户注册时,LOGINID长度不让超过5个字符,实际上数据库中这个字段是20个字符长库

LOGINID = trim(request("LOGINID"))
password = trim(request("password"))
confirm_password = trim(request("confirm_password"))
if (LOGINID="") then
response.write "你丫没名字呀,滚回去"
response.end
end if
if (password="") then
response.write "你丫开门不用钥匙,想做贼呢"
response.end
end if

if (password <> confirm_password) then
response.write "两次输入的密码不一致!"
response.end
end if
password=md5(password)
password=mid(password,"9","16")
set rs=server.CreateObject("adodb.recordset")
strsql="select * from USER where username='"&trim(LOGINID)&"'"
rs.open strsql,conn,1,1
if not rs.eof then
response.write"注册失败!"
response.write"您输入的用户名已经存在,请重新输入!

20个英文字符应该没有问题吧,汉字当然不能那么多了,因为汉字是变长的,至少占两个字节。

你可以把这个20扩大到32或者64试试看,如果能够注册更长的名字,那么尽量弄长点吧,反正你是varchar类型,数据暂用空间根据实际内容来确定,定义多大并不浪费。