Time for action – Creating the Users table
Firstly, we are going to create a table named Users
which will hold information about users. We will need the following three fields:
username
: Will hold the user's login.password
: Will hold the user's password hashed.id
: The Primary Key.
The following is the SQL query you can use to create this table:
CREATE TABLE 'Users' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'username' varchar(255) NOT NULL, 'password' varchar(255) NOT NULL, PRIMARY KEY ('id') ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
What just happened?
This will create the table and the ID will also have auto_increment
set on it.