Question: for this assignment, you are required to create a login system that accepts both (user, admin) roles to login but whenever admin logins show all

for this assignment, you are required to create a login system that accepts both (user, admin) roles to login but whenever admin logins show all the records inside the users' table, and admin can insert data into the database as well (by a form), and whenever normal user logins only show the records without the ability to add new records(only show the database records), and make sure that you show the user their roles, for example: (you are logged in as admin or normal user). SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; CREATE TABLE `users id" int(11) NOT NULL, username varchar(32) NOT NULL, password" varchar(32) NOT NULL, role varchar(32) NOT NULL ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT INTO `users ('id', 'username, password", "role ) VALUES (1, 'smith', '12345', 'admin'), (2, 'johnson', '54321', 'user'); ALTER TABLE `users ADD PRIMARY KEY ( id ); ALTER TABLE `users MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; COMMIT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
