<?php
// school_admission/config/db.php

// Prevent direct access to this file
if (basename(__FILE__) == basename($_SERVER['PHP_SELF'])) {
    die("Access denied!");
}

define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'mitiedun_combined'); // Default XAMPP username
define('DB_PASSWORD', 'miti@combine247');     // Default XAMPP password (empty)
define('DB_NAME', 'miti_admission_combination_db');

// Attempt to connect to MySQL database
$conn = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
// Set charset to utf8mb4 for proper emoji and special character support
$conn->set_charset("utf8mb4");
?>