Advertisement
Guest User

Untitled

a guest
May 7th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?PHP
  2.  
  3. class DBconnect
  4. {
  5.  
  6.     private $host   = "";
  7.     private $username = "";
  8.     private $password = "";
  9.     private $database = "";
  10.    
  11.     private $mysqli;   
  12.  
  13.     protected function connect()
  14.     {
  15.         $this->mysqli = new mysqli($this->host, $this->username, $this->password, $this->database) or die(mysql_error());
  16.  
  17.         return $this->mysqli;
  18.  
  19.     }
  20.  
  21.     protected function close()
  22.     {
  23.         $this->mysqli->close();
  24.     }  
  25.    
  26. }
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement