我正在使用addNewUser函数。 我收到错误:if($ stmt = $ Database-> prepare ...
$ Database是一个新的mysqli()
致命错误:在第89行的**中的非对象上调用成员函数prepare()
function addNewUser($username, $password, $userlevel, $email, $active = 0) {
global $Database;
$password = $this->encrypt($password);
$time = time();
if($stmt = $Database->prepare("INSERT INTO ".TBL_USERS." VALUES (?, ?, ?, ?, ?, ?)")) {
$stmt->bind_param('ssisis', $username, $password, $userlevel, $email, $active, $time);
$stmt->execute();
return TRUE;
} else {
return FALSE;
}
}