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

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…

Contents