<?php
// db.php - Clean version - UPDATED
 
if (!defined('SKIP_SESSION_START') && session_status() === PHP_SESSION_NONE) {
    session_start();
}

$host = "localhost";
$username = "uatunited_nusuportal";
$password = "?eJ*QquJN#hOtk;Z";
$database = "uatunited_nusudb";


$mysqli1 = new mysqli($host, $username, $password, $database);

if ($mysqli1->connect_errno) {
    error_log("Database connection error: " . $mysqli1->connect_error);
    http_response_code(500);
    die("Database connection failed. Please try again later.");
}

$mysqli1->set_charset('utf8mb4');
?>