mysqli准备错误

时间:2011-09-22 04:00:05

标签: php mysql mysqli

我正在使用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;
    }
}

0 个答案:

没有答案