public function __construct() { $passwords = new Passwords(); $this->conn = new mysqli($passwords->getDbHost(), $passwords->getDbUser(), $passwords->getDbPassword(), $passwords->getDb()); if ($this->conn->connect_error) { die("Connection failed: " . mysqli_connect_error()); } }