<?php
// config/koneksi.php
// File koneksi database murni, PHP 7.4 compatible

if (!function_exists('dblink')) {
    function dblink() {
        static $conn = null; // koneksi tunggal
        if ($conn === null) {
            $server   = "localhost";
            $username = "siaj4283_siaj4283"; // ganti sesuai DB
            $password = "pJp9b3gqr4qvS~[9";  // ganti sesuai DB
            $database = "siaj4283_akd";       // ganti sesuai DB

            $conn = mysqli_connect($server, $username, $password, $database);
            if (!$conn) {
                die("Koneksi database gagal: " . mysqli_connect_error());
            }
            mysqli_set_charset($conn, "utf8");
        }
        return $conn;
    }
}
?>
