SnippetManager/dbTools.php

14 lines
324 B
PHP
Raw Normal View History

2017-12-16 22:25:50 +00:00
<?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);
}
?>