Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1.     class isdu
  2.     {
  3.         private $host = "localhost";
  4.         private $user = "root";
  5.         private $pass = "";
  6.         private $db   = "laboratory";
  7.  
  8.         function __construct()
  9.         {
  10.  
  11.             $this->link = mysql_connect("$this->host","$this->user","$this->pass") or die (mysql_error());
  12.             $this->select = mysql_select_db($this->db,  $this->link) or die (mysql_error());
  13.            
  14.             if (!$this->link)
  15.             {
  16.                 echo "neprisijungta";
  17.             }
  18.         }
  19.        
  20.         function __destruct()
  21.         {
  22.             mysql_close($this->link);
  23.            
  24.             if (!$this->link)
  25.             {
  26.                 echo "neprisijungta";
  27.             }
  28.         }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement