DBServer = '192.168.1.6'; // Your DB server (example: localhost) $this->DBUser = 'phowell'; // Your DB username $this->DBPass = 'rolley34'; // Your DB password $this->DBName = 'db'; // Your DB name } // Method to establish a database connection public function getConnection() { $this->conn = new mysqli($this->DBServer, $this->DBUser, $this->DBPass, $this->DBName); // Check the connection if ($this->conn->connect_error) { die('Database connection failed: ' . $this->conn->connect_error); } // Set the character set $this->conn->set_charset('utf8'); return $this->conn; } } ?>