<?php
// 建立連線
$conn = new mysqli("localhost", "uesename", "password", if ($conn->connect_error)
# {
die("連線失敗: " . $ sql = "CREATE TABLE new (
id int(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
NOT NULL,
content text NOT NULL,
created_at datetime NOT NULL,
)ENGINE=InnoDB DEFAULT CHARSET=utf8 ";##
echo " Table MyGuests created successfully";
} else {
# echo "建立 ose();
?>
#
建立表格的語句,最後這裡不能有逗號,去掉應該就可以了。這個是sql語法,前面都需要逗號,最後不需要。
created_at datetime NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8 ";