Seperti kata Hobo Sapiens, host yang Anda sediakan tidak ada atau salah eja, saya tidak tahu struktur $request
Anda obyek. Struktur objek Anda harus seperti berikut ini.
class Request
{
private $host;
private $db_name;
private $db_username;
private $db_pwd;
public function __construct($host,$db_name,$db_username,$db_pwd) {
$this->host = $host;
$this->db_name = $db_name;
$this->db_username = $db_username;
$this->db_pwd = $db_pwd;
}
public function getHost(){
return $this->host;
}
public function getDBName(){
return $this->db_name;
}
public function getDBUsername(){
return $this->db_username;
}
public function getDBPwd(){
return $this->db_pwd;
}
}
Kemudian Anda dapat melakukan sesuatu seperti berikut
$request = new Request('localhost', 'TestingPDO', 'root', '');
$modelinstall = new modelInstall();
$modelinstall->main($request);