20 lines
494 B
PHP
20 lines
494 B
PHP
<?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());
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|