A user register system
DATABASE CREATING
command for creating the database:
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id VARCHAR(8) NOT NULL UNIQUE,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(60) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
last_login TIMESTAMP);
create the sessions
table:
CREATE TABLE sessions (
user_id INT NOT NULL,
session_id VARCHAR(32) NOT NULL,
expires TIMESTAMP NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id)
);