public function connect()
 {
     // Try and connect to the database
     if (!isset(self::$connection)) {
         self::$connection = new mysqli(self::$host, self::$username, self::$password, self::$database);
         self::$connection->set_charset('utf8');
     }
     // If connection was not successful, handle the error
     if (self::$connection === false) {
         // Handle error - notify administrator, log to a file, show an error screen, etc.
         echo 'Cannot connect to database.';
         return false;
     }
     return self::$connection;
 }