这段代码毫无问题地创建了第一个表,但随后抛出“Error Querying Database 2”,这是第二个 CREATE TABLE 查询的错误。语法看起来不错,但我对此比较陌生......
$dbc = mysqli_connect("localhost", "$dbuser", "$dbpass") or die('Error connecting to MySQL server.');
mysqli_select_db($dbc, "autoim9_codeaic");
$content = "CREATE TABLE content (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), page varchar(255), html longtext)";
mysqli_query($dbc, $content) or die('Error querying database1');
$events = "CREATE TABLE events (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name varchar(255), date varchar(255), time varchar(255), location varchar(255), html longtext, img varchar(255), link varchar(255), target varchar(255), order int)";
mysqli_query($dbc, $events) or die('Error querying database2');
$spotlight = "CREATE TABLE spotlight (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), title varchar(255), img varchar(255), link varchar(255), target varchar(255), order int)";
mysqli_query($dbc, $spotlight) or die('Error querying database3');