Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Autor: Rafael Clares - rafadinix@gmail.com
- */
- class Conexao{
- var $host = "localhost";
- var $user = "celebra_1";
- var $pswd = "";
- var $dbname = "celebra_celebra_1";
- var $con;
- var $strCon;
- function Conexao($dbname)
- {
- $this->dbname = $dbname;
- //$this->strCon = "'$this->host' , '$this->user' , '$this->pswd'";
- $this->Open();
- }
- function Open()
- {
- $this->con = mysql_connect("$this->localhost" , "$this->user" , "$this->pswd")
- or die ('Não foi possivel conectar-se ao banco de dados, por favor tente mais tarde!');
- mysql_select_db("$this->dbname");
- }
- function Stat()
- {
- if($this->con)
- {
- return 0;
- }
- else
- {
- echo 1;
- }
- }
- function Close()
- {
- pg_close($this->con);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement