<?php
class Database{

    private $database = "ruser420_rms";
    private $username = "ruser420_dev";
    private $password = "dbrms123";
    private $hostname = "localhost";
    //private $hostname = "0.0.0.0:3306";
    
    protected $connection;
    
    public function __construct(){
        if(!isset($this->connection)){
            $this->connection = new mysqli($this->hostname, $this->username, $this->password, $this->database);
            if(!$this->connection){
                echo "Cannot connect to database server";
                exit;
            }            
        }    
        return $this->connection;
    }

}
?>