Guest User

Untitled

a guest
Jun 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2. class dbase {
  3.     private $config = array();
  4.     public $conexao;
  5.     public $erro = array();
  6.    
  7.     public function __construct($banco,$servidor = 'localhost', $user ='root',$pass = '') {
  8.         $this->config['dbName'] = $banco;
  9.         $this->config['servidor'] = $servidor;
  10.         $this->config['user'] = $user;
  11.         $this->config['pass'] = $pass;
  12.        
  13.     }
  14.    
  15.     public function conectaDbase() {
  16.         $this->conexao = mysql_connect($this->config['servidor'],$this->config['user'],$this->config['pass'])
  17.         or die(mysql_error());
  18.     }
  19.    
  20.     public function selectDbase() {
  21.         mysql_select_db($config['dbName'],$this->conexao) or die(mysql_error());
  22.     }
  23.    
  24.     public function setCharset($charset) {
  25.         mysql_set_charset($charset);
  26.     }
  27. }
Add Comment
Please, Sign In to add comment