$DSN = "{$__s['SQL']}:host={$__s['SQLHOST']};port={$__s['SQLPORT']};dbname={$__s['SQLDB']}";
try
{
// PDO driver connection
$_pdo = new PDO($DSN, $__s['SQLUSER'], $__s['SQLPWD'],
array( // Driver-specific options
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_PERSISTENT => false,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
// MySQL exclusive stuff
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8;',
));
}
catch(Exception $e)
{
error_log('Unable to connect to database. (' . $e->getMessage() . ')');
die(1);
}
unset($__database, $__s, $DSN, $e);
$_s = $_pdo->getAttribute(PDO::ATTR_EMULATE_PREPARES);
print_r($_s);
die();