从数据库获取类型 [英] getting type from database

查看:87
本文介绍了从数据库获取类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。每个人



i有表登录包含用户名,密码,类型

取决于类型,将重定向到页面



我的系统有管理员,学生和讲师

每个人都有自己的页面和控件



如何根据用户名从表中获取类型(当用户输入并点击登录时,我将从文本框中获取该类型)



谢谢

hello everybody

i have table "Login" contain username, password, type
depend on the type, will be redirect to pages

my system have admin, student and instructor
each one has his own pages and controls

how to get the type from the table based on the username (i will take it from the textbox when the user type it and click login)

thanks

推荐答案

您将拥有

用户详细信息表存储用户用户ID的详细信息是pk

登录表,用于存储用户名和密码,用户ID为fk

同时您将拥有指定表,其中用户ID为fk和指定即管理员,学生或讲师。



现在使用join来记录用户的名称并按照名称进入下一页
You will be having
User details table to store details of user user id is pk
Login table to store user name and password here user id is fk
simlarly you will be having designation table in which user id if fk and the designation i.e. admin or student or instructor.

now use join to take the logged in user''s designation and proceed to next page according to the designation


这篇关于从数据库获取类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆