Advertisement
DesenvolverBatch

conexao.class.php

Oct 28th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. class conexao {
  4.  
  5.     private $conexao;
  6.     private $host="localhost";
  7.     private $usuario="root";
  8.     private $senha="";
  9.     private $banco="agenda";
  10.    
  11.     function _construct(){
  12.         $con = mysql_connect($this->host,$this->usuario,$this->senha);
  13.         if($con==false){
  14.             die ("Erro ao conectar");
  15.         }
  16.         else {
  17.             $this->conexao= $conexao;
  18.             $selectBD = mysql_select_db($this->banco,$this->conexao);
  19.             if($selectBD==false) {
  20.                 die ("Erro de seleção de Base de Dados.");
  21.             }
  22.         }
  23.  
  24.     }
  25.  
  26.    
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement