include_once("php/db_connects.php");
$tbl_status = "CREATE TABLE IF NOT EXISTS status (
id INT(11) NOT NULL AUTO_INCREMENT,
osid INT(11) NOT NULL,
account_name VARCHAR(16) NOT NULL,
author VARCHAR(16) NOT NULL,
type ENUM('a','b','c') NOT NULL,
data TEXT NOT NULL,
postdate DATETIME NOT NULL,
PRIMARY KEY (id)
)";
$query = mysqli_query($tbl_status, $db_connects);
if ($query === TRUE) {
echo "<h3>status table created </h3>";
} else {
echo "<h3>status table NOT created </h3>";
}
我一直收到mysqli错误。我很确定我在我的php中没有使用mysql。
答案 0 :(得分:1)
更改此
$query = mysqli_query($tbl_status, $db_connects);
到
$query = mysqli_query($db_connects, $tbl_status);
示例 mysqli_query(mysqli $ link,string $ query)
答案 1 :(得分:0)
mysqli_query
的签名是:
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
假设$db_connects
是存储mysqli_connect
结果的变量,您需要翻转参数以适应:
mysqli_query($db_connects, $tbl_status);