O'Reilly logo

haXe 2 by Benjamin Dasnois

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

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.

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