2017-05-12 57 views

回答

0

下面的代碼(包含在您提供的鏈接中)是您可以按原樣執行的模式(它將爲您生成表)。這說明你需要的列名和列名,包括,我注意到你需要的列包括:

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; 
+0

啊,對不起,我錯過了。你知道如何運行該塊 –

0

閱讀PHPLogin幫助,需要特定的數據庫模式:

https://github.com/fethica/PHP-Login#creating-the-mysql-database

如果您使用的是mysql,請在您的數據庫中執行以下語句:

CREATE TABLE `members` (
    `id` char(23) NOT NULL, 
    `username` varchar(65) NOT NULL DEFAULT '', 
    `password` varchar(65) NOT NULL DEFAULT '', 
    `email` varchar(65) NOT NULL, 
    `verified` tinyint(1) NOT NULL DEFAULT '0', 
    `mod_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 
    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, 
    `Attempts` int(11) NOT NULL, 
    `LastLogin` datetime NOT NULL, 
    `Username` varchar(65) DEFAULT NULL, 
    `ID` int(11) NOT NULL AUTO_INCREMENT, 
    PRIMARY KEY (`ID`) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8; 

否則手動創建它

+0

啊,對不起,我錯過了。那是什麼? –