What to put in database columns when creating registration/login system? (xampp)

The code below (which is contained within the link you have provided) is the schema you can execute as is (which will generate the tables for you). This shows the columns and column names you would need to include, I have noted which columns you would need to include:

CREATE TABLE `members` (
  `id` char(23) NOT NULL, /* INCLUDE THIS COLUMN */
  `username` varchar(65) NOT NULL DEFAULT '', /* INCLUDE THIS COLUMN */
  `password` varchar(65) NOT NULL DEFAULT '', /* INCLUDE THIS COLUMN */
  `email` varchar(65) NOT NULL, /* INCLUDE THIS COLUMN */
  `verified` tinyint(1) NOT NULL DEFAULT '0', /* INCLUDE THIS COLUMN */
  `mod_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, /* INCLUDE THIS COLUMN */
  PRIMARY KEY (`id`),
  UNIQUE KEY `username_UNIQUE` (`username`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  UNIQUE KEY `email_UNIQUE` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `loginAttempts` (
  `IP` varchar(20) NOT NULL, /* INCLUDE THIS COLUMN */
  `Attempts` int(11) NOT NULL, /* INCLUDE THIS COLUMN */
  `LastLogin` datetime NOT NULL, /* INCLUDE THIS COLUMN */
  `Username` varchar(65) DEFAULT NULL, /* INCLUDE THIS COLUMN */
  `ID` int(11) NOT NULL AUTO_INCREMENT, /* INCLUDE THIS COLUMN */
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Leave a Comment