1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
PHP_TP_Note/lib/getPDD.php
2020-11-13 09:13:03 +01:00

12 lines
334 B
PHP

<?php
function getPDO() {
try {
$bdd = new PDO("mysql:host=" . BD_HOST . ";dbname=" . BD_DBNAME . ";charset = utf8", BD_USER, BD_PWD);
$bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$bdd->exec("set names utf8");
return $bdd;
} catch (Exception $e) {
return $e;
}
}