我有一个mysql代码,所以我想更改为mysqli,但是我有一个错误

时间:2019-06-15 04:08:11

标签: mysqli

我对此错误有疑问,该如何解决?谢谢

注意:未定义的变量:第14行/opt/lampp/htdocs/hanleecome/index.php中的com

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /opt/lampp/htdocs/hanleecome/admin/lib/class.database.php on line 100

语法错误:从table_setting中选择*

我的class.database.php文件

function query($sql=""){
        if($sql)
            $this->sql = str_replace('#_', $this->refix, $sql);
        $this->result = mysqli_query($this->db,$this->sql);
        if(!$this->result){
            #die(mysql_errno($this->db) . ": " . mysql_error($this->db));
            die("syntax error: ".$this->sql);
        }
        return $this->result;   
    }

0 个答案:

没有答案