返回首页

我有两个表。
1.Admin(用户名,密码)
2.User(用户名,类型)
我已经给定的用户名和密码,我想检索用户从用户表的类型。:7909353 |会员

回答

评论会员:游客 时间:2012/02/06
codeprelang="SQL"spanclass="code-keyword"select/spantypespanclass="code-keyword"from/span[spanclass="code-keyword"User/span]spanclass="code-keyword"where/spanusername=spanclass="code-string"'/spanspanclass="code-string"the_username_wanted'/span/pre/code
赖斯:一个简单的连接是你是什么

{C}
也有对CP的好文章,有关联接]
评论会员:MrProgrammer_78 时间:2012/02/06
{的C2}
@ username是一个参数,你必须把它传递给存储过程或SQL语句
评论会员:游客 时间:2012/02/06
member60:更好的使用管理表的标识列和它的主键在user表中,采取friegn键(eg.UserId)的,然后尝试以下查询:{体C3}
木孔德Thakker
评论会员:{的C4} 时间:2012/02/06
王子安东尼G
评论会员:{C5的} 时间:2012/02/06