This commit is contained in:
2022-05-24 15:00:21 +02:00
parent 32a093d982
commit e8b40afaa8
13 changed files with 665 additions and 0 deletions

18
TP5/lib/common.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
function initDatabase() {
$dir = dirname(__FILE__);
try {
$db = new PDO (
'mysql:host=localhost;dbname=securite',
'',
'');
//
//$db = new PDO('sqlite:' . $dir .'/database.sq3');
// $db = new PDO('mysql:host=localhost;dbname=Base', 'login', 'mdp');
} catch (PDOException $e) {
die('DB error: ' . $e->getMessage());
}
return $db;
}