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

13 lines
334 B
PHP
Raw Normal View History

2020-11-13 08:50:55 +01:00
<?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;
}
}