Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted
Comments
Monster Maker 25-Mar-13 3:50am    
can't you ask the user to select if he is admin, student or instructor?
Ali M Alramil 25-Mar-13 3:54am    
yes that was my idea
to creat 3 tabels and based on the user type will get from the specifed table

but my instructor refuse the idea lol
saguptamca 25-Mar-13 3:59am    
Create 2 Tables:
First contains all the details(Table "LOGIN"): Username, Password, Type, fkTypeDetails

Second contains field depends on Type, in current case 3 Rows would be sufficient:
(Table TypeDetails)
Fields: pkTypeID, your pages for that id, your controls for that id

Hope this helps u...
Monster Maker 25-Mar-13 4:01am    
Hmm, can't you give user the dropdown option and let him select , is he admin, student or instructor.

Once you know what type is he, you can simply add that condition in the where clause.

1 solution

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
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900