public function connect() {

		if(false === $this -> connection instanceof \mysqli) {
			
			$this -> connection = new \mysqli($this -> data -> host, $this -> data -> username, $this -> data -> password, $this -> data -> db, $this -> data -> port);
			
			if($this -> data -> charset) {
	            $this -> connection -> set_charset($this -> data -> charset);
	        }
		}
	}
public function connect() {

		if(false === $this -> connection instanceof \mysqli) {
			
			$this -> connection = new \mysqli($this -> data -> host, $this -> data -> username, $this -> data -> password, $this -> data -> db, $this -> data -> port);
			
			if($this -> data -> charset) {
	            $this -> connection -> set_charset($this -> data -> charset);
	        }
		}
	}
public function connect ( ) { if ( false === $ this -> connection instanceof \ mysqli ) { $ this -> connection = new \ mysqli ( $ this -> data -> host , $ this -> data -> username , $ this -> data -> password , $ this -> data -> db , $ this -> data -> port ) ; if ( $ this -> data -> charset ) { $ this -> connection -> set_charset ( $ this -> data -> charset ) ; } } }
Connect to Mysql server and set charset
Connect to Mysql server and set charset