<?php

/**
 * Description of Conexao
 *
 * @author Eticons
 */
class Conexao {

    private $conn = null;
    private $persistent = false;

    public function getConexao() {
        try {
            $this->conn = new PDO("mysql:host=localhost;dbname=eticon_site", 
								  "eticon_admin", 
								  "&_uc905p$8", 
								  array(PDO::ATTR_PERSISTENT => $this->persistent));
            //$this->conn = new PDO("mysql:host=localhost;dbname=e_ticons", "root", "123456", array(PDO::ATTR_PERSISTENT => $this->persistent));
			return $this->conn;
            
			if (!$this->conn) {
                die('Could not connect to MySQL: ' . mysqli_connect_error());
                return null;
            }
        } catch (PDOException $exc) {
            die($exc->getMessage());
        }
    }

    public function desconectar() {
        $this->conn = null;
    }

}

?>
