<?php
	class systemMYSQLI {
		private $mHost, $mUser, $mPass, $mData, $mPort;
		public $mConnection;
		
		public function initializeConnection($mHost, $mUser, $mPass, $mData, $mPort = 3306) {
			$this->mHost = $mHost;
			$this->mUser = $mUser;
			$this->mPass = $mPass;
			$this->mData = $mData;
			$this->mPort = $mPort;
			
			$this->initializeCorrectHost();
			$this->openConnection();
		}
		
		private function initializeCorrectHost() {
			$this->mHost = $this->mPort !== 3306 ? $this->mHost.':'.$this->mPort : $this->mHost;
		}
		
		private function openConnection() {
			$this->mConnection = new mysqli($this->mHost, $this->mUser, $this->mPass, $this->mData);
		}
	}
?>