1e versie
This commit is contained in:
14
includes/db.php
Normal file
14
includes/db.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$config = require __DIR__ . '/../config/config.php';
|
||||
|
||||
try {
|
||||
$pdo = new PDO(
|
||||
"mysql:host={$config['db']['host']};dbname={$config['db']['name']};charset=utf8mb4",
|
||||
$config['db']['user'],
|
||||
$config['db']['pass'],
|
||||
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
die("Databaseverbinding mislukt: " . $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user