为什么在布尔值的execute()上尝试绑定和关闭时出错?

我是编码新手。当前正在尝试设置注册表格。我一直在寻找答案,因为我看到在execute()起作用之前可能会绑定参数。但是,我不知道该怎么做。请帮忙。下面的代码显示以下错误:

致命错误:未捕获错误:在C:\ xampp \ htdocs \ kibble \ php-user-registration-form \ DataSource.php:99布尔值上调用成员函数execute():堆栈跟踪:#0 C:\ xampp \ htdocs \ kibble \ php-user-registration-form \ Member.php(83):Phppot \ DataSource-> insert('INSERT INTO reg ...','ssss',Array)#1 C:\ xampp \ htdocs \ kibble \ php-user-registration-form \ index.php(20):Phppot \ Member-> insertMemberRecord('lalafasdf123','Moka24','123123123123','localoca @ gmail ....')#2 {main}第99行的C:\ xampp \ htdocs \ kibble \ php-user-registration-form \ DataSource.php中引发
    public function insert($query, $paramType, $paramArray)
    {
        print $query;
        $stmt = $this->conn->prepare($query);
        $this->bindQueryParams($stmt, $paramType, $paramArray);
        $stmt->execute();
        $insertId = $stmt->insert_id;
        return $insertId;
    }

如果需要插入功能

    function insertMemberRecord($username, $displayName, $password, $email)
    {
        $passwordHash = md5($password);
        $query = "INSERT INTO registered_users (user_name, display_name, password, email) VALUES (?, ?, ?, ?)";
        $paramType = "ssss";
        $paramArray = array(
            $username,
            $displayName,
            $passwordHash,
            $email
        );
        $insertId = $this->ds->insert($query, $paramType, $paramArray);
        return $insertId;
    }
评论