Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class dbase {
- private $config = array();
- public $conexao;
- public $erro = array();
- public function __construct($banco,$servidor = 'localhost', $user ='root',$pass = '') {
- $this->config['dbName'] = $banco;
- $this->config['servidor'] = $servidor;
- $this->config['user'] = $user;
- $this->config['pass'] = $pass;
- }
- public function conectaDbase() {
- $this->conexao = mysql_connect($this->config['servidor'],$this->config['user'],$this->config['pass'])
- or die(mysql_error());
- }
- public function selectDbase() {
- mysql_select_db($config['dbName'],$this->conexao) or die(mysql_error());
- }
- public function setCharset($charset) {
- mysql_set_charset($charset);
- }
- }
Add Comment
Please, Sign In to add comment