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

12 lines
296 B
PHP
Raw Permalink Normal View History

2020-10-16 11:57:47 +02: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);
return $bdd;
} catch (Exception $e) {
return $e;
}
}