13 lines
334 B
PHP
13 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;
|
||
|
}
|
||
|
}
|