This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am making one application in which 3 users are there. I am confused at the time login how can i know that which user is login and which page I have to call and also tell me primary key and foreign key of table. my users are: STUDENT,FACULTY,ADMIN if possible than explain with some example.
How can we tell you what the primary and foreign keys of your table are?
At login time the person logs in giving (presumably) a username and password--that's how you know who's logging in. They tell you.
Are your *users* "STUDENT", "FACULTY", and "ADMIN", or are those the *types* of users?
Joined: Jul 15, 2010
yes they are types of user...one table of user in which userid-pk and usertype fields another table login in which loginid-pk,username,password and userid-fk third is register in which sign up detail and loginid-fk
You should have a "users" table in the database with a "role" column that stores whether they are a student, faculty, or admin. Then, when they login, you use the username and password they entered to find the row that represents the user in the table. Use the value of the "role" column to determine what kind of user they are.