SnippetManager/dbTools.php
2017-12-16 14:25:50 -08:00

14 lines
324 B
PHP

<?php
function buildPDO() {
include_once "info.php";
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
return new PDO($dsn, $user, $pass, $opt);
}
?>