<?php
/**
  * User: David Camacho
 * Date: 30/03/2015
 * Time: 17:19
 */

class DataBaseController {

    protected $db;

    public function DataBaseController(){

            // New Connection
            $this->db = new mysqli(_domain, _db_user, _db_password, _db_name);

            // Check for errors
            if(mysqli_connect_errno()){
                echo mysqli_connect_error();
            }

            //UTF8 Queries
            $this->setUTF8Names();


    }
    private function setUTF8Names(){
        $sql = "SET NAMES 'utf8'";

        $tmp = $this->db->prepare($sql);
        $tmp->execute();
        $tmp->close();

        return;
    }
}