我正在使用mysqli登录,并且我不断收到这些错误。 http://i.imgur.com/9trbJ54.png
<?php
class Database {
public function __construct() {
$host = 'localhost';
$user = 'root';
$pass = 'login';
$name = 'meeboo1';
$this->mysqli = new mysqli($this->host, $this->user, $this->pass, $this->name);
}
}
?>
有人可以告诉我我做错了什么吗?我以为他们已经被宣布了?
答案 0 :(得分:0)
你应该尝试访问你内部定义的变量,如下所示:
$this->mysqli = new mysqli($host, $user, $pass, $name);