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_TP4/lib/getPDD.php
2020-10-27 22:38:13 +01:00

11 lines
296 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);
return $bdd;
} catch (Exception $e) {
return $e;
}
}