<?
Class Config
{
const dbHost = 'localhost';
const db = 'db';
const dbUser = 'user';
const dbPassword = 'pass';
}
try
{
$db = new PDO("mysql:host=".Config::dbHost.";dbname=".Config::db."", Config::dbUser, Config::dbPassword);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("set names utf8");
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>