谁能指出这是否有任何错误?有人告诉我有错误,我只能通过 localhost 连接,而不是通过这个主机名..
有人告诉我,我在 db.class.php 中设置的密码是错误的。部分代码如下所示。赞赏!
function __construct($hostname = "192.xx.x.45", $username = "test", $password = "tests", $database = "testing", $prefix = "prefix_", $connector = "mysqli") {
$this->hostname = !empty($hostname) ? $hostname : "";
$this->username = !empty($username) ? $username : "";
$this->password = !empty($password) ? $password : "";
$this->database = !empty($database) ? $database : "";
$this->prefix = !empty($prefix) ? $prefix : "";
$this->connector = !empty($connector) ? $connector : "mysqli";
}
if ($this->config->connector == "mysqli") {
$this->connection = mysqli_connect($this->config->hostname, $this->config->username, $this->config->password);
$this->selectdb = mysqli_select_db($this->connection, $this->config->database);
}