<?php
// Prevent direct access
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type");

$host = "localhost";
$username = "root"; // Change this to your database username
$password = "";     // Change this to your database password
$dbname = "elitehighsch";

$conn = new mysqli($host, $username, $password, $dbname);

if ($conn->connect_error) {
    die(json_encode(["error" => "Connection failed: " . $conn->connect_error]));
}

// Set charset to handle special characters
$conn->set_charset("utf8mb4");
?>