Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.