11 lines
296 B
PHP
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;
|
|
}
|
|
}
|