Advertisement
Guest User

Untitled

a guest
May 31st, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. class MySQL
  2. {
  3.     private $host,
  4.             $user,
  5.             $pass,
  6.             $db;
  7.            
  8.     public function __construct($host, $user, $pass, $db)
  9.     {
  10.         $this->host = $host;
  11.         $this->user = $user;
  12.         $this->pass = $pass;
  13.         $this->db = $db;
  14.     }
  15.    
  16.     public function connect()
  17.     {
  18.         mysql_connect($this->host, $this->user, $this->db)
  19.             or die(mysql_error());
  20.         mysql_select_db($this->db)
  21.             or die(mysql_error());
  22.     }
  23.    
  24.     public function close()
  25.     {
  26.         mysql_close();
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement