<?php
// Set timezone for Sri Lanka
date_default_timezone_set('Asia/Colombo');

// Database configuration
$host = 'localhost';
$db   = 'cwktwqbhbk_malshan';
$user = 'cwktwqbhbk_malshan';
$pass = 'Ravindu2001@';

// Enable persistent connections for better performance
$conn = new mysqli($host, $user, $pass, $db, 3306, null);

if ($conn->connect_error) {
    die('Connection failed: ' . $conn->connect_error);
}

// Set MySQL timezone to Sri Lanka
$conn->query("SET time_zone = '+05:30'");

// Set UTF-8 encoding for MySQL connection
$conn->set_charset('utf8mb4');

// Performance optimizations
// Note: MySQL Query Cache is removed in MySQL 8 and cannot be enabled per session.
// Avoid enabling query cache to prevent fatal errors on hosts that disable it globally.
$conn->query("SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION'");
?>
