From the course: PHP with MySQL Essential Training: 2 Build a CMS
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Create admins table
From the course: PHP with MySQL Essential Training: 2 Build a CMS
Create admins table
- [Instructor] In the last movie, you'll recall that the first step in user authentication is to add the person's credentials or their username, and password to the database. To do that we first need a database table that can store those credentials. The SQL command we need to do this is CREATE TABLE, then we provide the table name and then in parentheses, the column definitions. You can see here I have a primary key of ID, then I have columns for first name, last name, email, username, and hash password. All of those are going to be of type varchar, and have a length of 255 characters because they're just going to store strings in them. Now, first name, last name and email are really just conveniences. So, I really know who this person is in real life and how I can reach them. The most important part of the credentials are the last two, their username and their password. Notice that I don't call it just password though, I call it hashed_password. Hash is another name for an encrypted…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
User authentication overview5m 11s
-
(Locked)
Create admins table3m 7s
-
(Locked)
Challenge: Build admin management3m 52s
-
(Locked)
Solution: Build admin management6m 30s
-
(Locked)
PHP password functions7m 27s
-
(Locked)
Authenticate user access8m 27s
-
(Locked)
Require authorization6m 15s
-
(Locked)
Log out a user2m 48s
-
(Locked)
Optional password updating6m 2s
-
(Locked)
Authorized previewing3m 46s
-
(Locked)
-
-