Advertisement
Guest User

Connection.php

a guest
Apr 9th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.     class Connection
  3.     {
  4.         private $Connect = FALSE;
  5.  
  6.         private $Host = '127.0.0.1';
  7.         private $User = 'root';
  8.         private $Pass = '';
  9.         private $Data = 'Database';
  10.  
  11.         public function __construct()
  12.         {
  13.             $this->Connect();
  14.  
  15. //          if(connection_aborted() == TRUE)
  16. //          {
  17. //
  18. //          }
  19.         }
  20.  
  21.         private function Connect()
  22.         {
  23.             $this->Connect = new mysqli($this->Host, $this->User, $this->Pass, $this->Data);
  24.  
  25.             if($this->Connect->connect_errno)
  26.             {
  27.                 exit('Não foi possível realizar a Conexão.');
  28.  
  29.                 return FALSE;
  30.             }
  31.  
  32.             return TRUE;
  33.         }
  34.     }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement