Advertisement
Guest User

celebra cerimonial

a guest
Nov 26th, 2012
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php  
  2. /*
  3. Autor: Rafael Clares  - rafadinix@gmail.com
  4. */
  5. class Conexao{    
  6. var $host = "localhost";   
  7. var $user = "celebra_1";   
  8. var $pswd = "";
  9. var $dbname = "celebra_celebra_1"; 
  10. var $con;  
  11. var $strCon;     
  12.  
  13.   function Conexao($dbname)
  14.   {
  15.     $this->dbname   =  $dbname;
  16.     //$this->strCon =  "'$this->host' , '$this->user' , '$this->pswd'";  
  17.     $this->Open(); 
  18.   }  
  19.  
  20.   function Open()
  21.   {
  22.     $this->con = mysql_connect("$this->localhost" , "$this->user" , "$this->pswd")
  23.     or die ('Não foi possivel conectar-se ao banco de dados, por favor tente mais tarde!');   
  24.     mysql_select_db("$this->dbname");
  25.   }  
  26.  
  27.   function Stat()
  28.   {
  29.     if($this->con)
  30.       {
  31.         return 0;      
  32.     }
  33.     else       
  34.     {  
  35.         echo 1;    
  36.     }
  37.   }    
  38.  
  39.   function Close()
  40.   {
  41.     pg_close($this->con);  
  42.   }
  43.  
  44.   }  
  45.   ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement