<?php
    $dbconf = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"]."/credentials/sql_config.json"));
    try {
        $db = new PDO("mysql:host=$dbconf->host;charset=utf8mb4;dbname=$dbconf->dbname",
                  "$dbconf->user", "$dbconf->pass");
    } catch (PDOException $ex)
    {
        die("Error connecting to SQL server.");
    }
?>
