Connect
<?php
class connect{
private $host;
private $user;
private $pwd;
private $database;
private $con;
public function __construct($host,$user,$pwd,$database){
$this->host = $host;
$this->user = $user;
$this->pwd = $pwd;
$this->database = $database;
$this->con = new mysqli($this->host,$this->user,$this->pwd,$this->database) or die("Error: ".mysqli_error());
}
public function getConnection(){
//return self::$con; if static member
return $this->con;
}
public function closeConnection(){
$this->con->close();
}
}