美好的一天我在使用电子邮件而不是用户名来使这个数据库工作时遇到了问题但是它似乎不起作用。一个解释的解决方案将受到高度赞赏。提前谢谢
$tbl_users = "CREATE TABLE IF NOT EXISTS users (
id INT (11) NOT NULL AUTO_INCREMENT,
firstname VARCHAR (16) NOT NULL,
lastname VARCHAR (16) NOT NULL,
username VARCHAR (16) NOT NULL,
age VARCHAR (16) NOT NULL,
gender ENUM ('m','f') NOT NULL,
email VARCHAR (255) NOT NULL,
website VARCHAR (255) NULL,
country VARCHAR (255) NULL,
userlevel ENUM ('a','b','c','d') NOT NULL DEFAULT 'a',
avatar VARCHAR (255) NULL,
ip VARCHAR (255) NOT NULL,
signup DATETIME NOT NULL,
lastlogin DATETIME NOT NULL,
notescheck DATETIME NOT NULL,
activated ENUM ('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (id),
UNIQUE KEY email
)";
$query = mysqli_query ($db_conx, $tbl_users);
if ($query === TRUE) {
echo "<h3>user table created</h3>";
} else {
echo "<h3>user table not created</h3>";
}