Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. class Connect{
  3.  
  4. private $host = "localhost";
  5. private $user = "root";
  6. private $pass = "";
  7. private $db = "phpgames";
  8. private $message_error = "Erro ao efetuar conexão com o bando de dados, entre em contato com o administrador do sistema.";
  9.  
  10. protected function getHost(){ return $this->host;}
  11. protected function getUser(){ return $this->user;}
  12. protected function getPass(){ return $this->pass;}
  13. public function getDb(){ return $this->db;}
  14. protected function getErro(){ return $this->message_error;}
  15.  
  16. public function ConnectToDb(){
  17. $dbc = mysqli_connect($this->getHost(), $this->getUser(), $this->getPass(), $this->getDb());
  18.  
  19. return ($dbc);
  20. }
  21.  
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement