select count(*) from user where userid='xxx' and pwd = 'xxx'如果结果是大于0 就可以继续了当然 如果你的密码是加密的话 
select pwd from user where userid='xxx' 取出来的结果解密和当前输入的结果相比较。