Advertisement
Guest User

Untitled

a guest
May 13th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. class conection{
  3.     public $_host;
  4.     public $_user;
  5.     public $_pass;
  6.     public $_db;
  7.  
  8.     function __construct($host,$user,$pass,$db){
  9.         $this->_host = $host;
  10.         $this->_user =$user;
  11.         $this->_pass = $pass;
  12.         $this->_db =$db;
  13.  
  14.         self::conectar();
  15.     }
  16.     public function conectar(){
  17.         $conexao = mysql_connect($this->_host,$this->_user,$this->_pass);
  18.         mysql_select_db($this->_db, $conexao);
  19.     }
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement