Branche classes

This commit is contained in:
2025-09-14 22:19:37 +02:00
parent 2a1804109b
commit 1aafd18ccd
10 changed files with 80 additions and 22 deletions

20
donnees/Database.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
class Database {
private $ip = "localhost";
private $user = "adminBibli";
private $pass = "mdpBibli";
private $database = "bdbibliotheque";
public function connexionDB() {
$dsn = "mysql:host=$this->ip;dbname=$this->database;charset=utf8mb4";
try {
$db = new PDO($dsn, $this->user, $this->pass);
return $db;
} catch (PDOException $e) {
die("Erreur de connexion : " . $e->getMessage());
}
}
}
?>