File size: 852 Bytes
14d32bc
 
 
554c58a
 
 
 
14d32bc
 
 
 
 
554c58a
 
 
 
 
14d32bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4a25dc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
class DataAccess
{
    private $host;
    private $username;
    private $password;
    private $dbname;

    private $conection;

    public function __construct()
    {
        $this->host = getenv("TZ_HOST");
        $this->username = getenv("TZ_USER");
        $this->password = getenv("TZ_PASSWORD");
        $this->dbname = getenv("TZ_NAME_DATA_BASE");

        $this->conection = new mysqli($this->host, $this->username, $this->password, $this->dbname);
        if ($this->conection->connect_error) {
            die('Error de Conexión (' . $this->conection->connect_errno . ') ' . $this->conection->connect_error);
        }
    }

    public function executeQueryGet($queryExecue)
    {
        return $this->conection->query($queryExecue);
    }

    public function closeConection()
    {
        $this->conection->close();
    }
}
?>