为什么在警告中有错误:mysql_fetch_assoc()期望参数1是资源,在第20行的C:\ wamp64 \ www \ ejeplo4 \ dbcontroller.php中给出布尔值[复制]

Error show is:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp64\www\ejeplo4\dbcontroller.php on line 20

My code:

<?php

class DBController {
    private $host = "localhost";
    private $user = "root";
    private $password = "";
    private $database = "sicci";
    private $conn;

    function __construct() {
        $this->conn = $this->connectDB();
    }

    function connectDB() {
        $conn = mysqli_connect($this->host,$this->user,$this->password,$this->database);
        return $conn;
    }

    function runQuery($query) {
        $result = mysqli_query($this->conn,$query);
        while($row=mysqli_fetch_assoc($result)) {
            $resultset[] = $row;
        }       
        if(!empty($resultset))
            return $resultset;
    }

    function numRows($query) {
        $result  = mysqli_query($this->conn,$query);
        $rowcount = mysqli_num_rows($result);
        return $rowcount;   
    }
}

?>
</div>

You are mixing mysql and mysqli functions. Change mysql to mysqli and fix the parameters you're passing.