Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
<?php
class Database {
private $host = 'localhost';
private $dbname = 'klas4s23_586648';
private $user = 'klas4s23_586648'; // MySQL root user
private $pass = 'gq7YLN6p'; // Replace with your actual MySQL password
private $pdo;
public function __construct() {
try {
$this->pdo = new PDO("mysql:host={$this->host};dbname={$this->dbname}", $this->user, $this->pass);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Database connection failed: " . $e->getMessage());
}
}
public function getConnection() {
return $this->pdo;
}
}
?>