O'Reilly logo

Building a Web Application with PHP and MariaDB: A Reference Guide by Sai Srinivas Sriparasa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User roles

In this section, let's begin by creating administrators who will have access across the student portal and will be able to perform operations such as adding courses and registering any student for a course. Let's begin by creating a few administrators. We will be building an admin table that will store the information for the administrators. The following script will create the admin table and add a couple of administrators. The script is saved as the assets/sql/admin.sql file:

CREATE TABLE IF NOT EXISTS 'admin' ( 'admin_id' int(11) NOT NULL AUTO_INCREMENT, 'name' varchar(45) NOT NULL, 'username' varchar(45) NOT NULL, 'password' varchar(45) NOT NULL, PRIMARY KEY ('admin_id') ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required