我有它成立時,我的表創建呼應,但用戶表是不會,我已經看了多個解決方案,但它們都沒有在這裏幫助我的代碼MySQL不會創建表
<?
phpinclude_once("index.php");
$tbl_users = "CREATE TABLE IF NOT EXISTS users
(
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(16) NOT NULL,
email VARCHAR(64) NOT NULL,
password VARCHAR(64) NOT NULL,
gender ENUM('m','f') NOT NULL,
website VARCHAR(64) NULL,
country VARCHAR(64) NULL,
userlevel ENUM('a','b','c','d') NOT NULL DEFAULT a,
avatar VARCHAR(64) NULL,
ip VARCHAR(64) 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 username (username,email))";
$query = mysqli_query($db_spooky, $tbl_users);
if ($query === TRUE)
{
echo "<h3>user table created OK :) </h3>";
}
else
{
echo "<h3>user table NOT created :(</h3>";
}
?>
最新錯誤? –
請正確格式化您的代碼。這很難閱讀,而且會引入語法錯誤。 – aynber
您的查詢中有太多的右括號。 – aynber