????
| Current Path : /home/carpe/public_html/CURSED/ |
| Current File : /home/carpe/public_html/CURSED/database.php |
<?php
class Database {
private $host = "localhost";
private $db_name = "carpe_cursed";
private $username = "carpe_php";
private $password = "onestdestubesonestpasdespots";
private $conn;
public function getConnection() {
$this->conn = null;
try {
$this->conn = new PDO(
"mysql:host=" . $this->host . ";dbname=" . $this->db_name,
$this->username,
$this->password
);
$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $exception) {
echo "Erreur de connexion : " . $exception->getMessage();
}
return $this->conn;
}
}
?>