14 lines
324 B
PHP
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);
|
|
}
|
|
?>
|