<?php

	if(!isset($databaseConfig)){
		require(__DIR__ . '/../config/database.php');
	}

	$host = 'host=' . $databaseConfig['host'] . ';';
	$name = 'dbname=' . $databaseConfig['name'];

    try{
        $db = new PDO('mysql:' . $host . $name, $databaseConfig['user'], $databaseConfig['pass']);
        $db->exec("SET NAMES utf8");
    }catch(Exception $e){
        die($e->getMessage());
    }