public function __construct() { parent::__construct(); }
self::serverVar(); } public function serverVar() { // offline version $this->hostname = "localhost"; $this->selectdb = "kinula"; $this->username = "******"; $this->password = ""; } } class serverConnect extends serverConfig { public function __construct() { parent::__construct(); self::constructConnection(); } public function constructConnection() { $this->connection = new PDO("mysql:host=" . $this->hostname . ";dbname=" . $this->selectdb, $this->username, $this->password); return $this->connection; } } // SERVER CONNECTION ERROR $connection = new serverConnect(); try { $connection->constructConnection(); } catch (PDOException $e) { echo '<b>Unknown Error:</b> ' . $e->getMessage(); }