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:

  1. username: Will hold the user's login.
  2. password: Will hold the user's password hashed.
  3. 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.

Get haXe 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.