•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,873 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,384 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 2390 | Replies: 1
![]() |
•
•
Join Date: Nov 2005
Posts: 44
Reputation:
Rep Power: 3
Solved Threads: 0
hiya in my database i have a users table
Create Table Users(
user_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
email varchar (40) NOT NULL,
pass CHAR (40) NOT NULL,
first_name varchar (15) NOT NULL,
last_name varchar (30) NOT NULL,
active CHAR (32),
registration_date datertime NOT NULL,
PRIMARY KEY(member_id),
UNIQUE KEY (email),
KEY (email, pass)
)
I want the administrator to be able to login from the same location as the user however when logged in different admin links would appear for the admin pages How would i do this if someone could pleaase let me know i would be greatful
thanks Brims
Create Table Users(
user_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
email varchar (40) NOT NULL,
pass CHAR (40) NOT NULL,
first_name varchar (15) NOT NULL,
last_name varchar (30) NOT NULL,
active CHAR (32),
registration_date datertime NOT NULL,
PRIMARY KEY(member_id),
UNIQUE KEY (email),
KEY (email, pass)
)
I want the administrator to be able to login from the same location as the user however when logged in different admin links would appear for the admin pages How would i do this if someone could pleaase let me know i would be greatful
thanks Brims
•
•
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation:
Rep Power: 4
Solved Threads: 19
well, first of all, you need a field that indicates whether they are administrator or not
i would suggest something like
admin tinyint NOT NULL Default 0
set it to 1 for administrators
Second, well that will depend on what you are coding in.
In asp, I would check that flag during the login process and set a session variable. Have your page check that session variable and only display the admin links if value is 1.
i would suggest something like
admin tinyint NOT NULL Default 0
set it to 1 for administrators
Second, well that will depend on what you are coding in.
In asp, I would check that flag during the login process and set a session variable. Have your page check that session variable and only display the admin links if value is 1.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
- user authentication and authorization (JSP)
- How to set permission to access a table on another database? (MS SQL)
- Extracting data from large SINGLE-table database to MULT-table relational database (MySQL)
- how to create table to database when program is running (VB.NET)
- Login and retrieve user data from database (ASP.NET)
Other Threads in the MySQL Forum
- Previous Thread: Mysql problem-HEELPP!!!
- Next Thread: Mysql Php Image Help Please!!!


Linear Mode