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