Advertisement
Guest User

Untitled

a guest
Apr 13th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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 $connection;
  9. private $message_error = "Erro ao efetuar conexão com o bando de dados, entre em contato com o administrador do sistema.";
  10.  
  11. protected function getHost(){ return $this->host;}
  12. protected function getUser(){ return $this->user;}
  13. protected function getPass(){ return $this->pass;}
  14. public function getDb(){ return $this->db;}
  15. protected function getErro(){ return $this->message_error;}
  16.  
  17. public function ConnectToDb(){
  18. $this->connection = mysqli_connect($this->getHost(), $this->getUser(), $this->getPass(), $this->getDb());
  19. }
  20.  
  21. function query($query) {
  22.  
  23. return mysqli_query($this->connection, $query);
  24. }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement