<?php

date_default_timezone_set('Asia/Jakarta');

$host="localhost";
$user="root";
$password="";
$db="db_bilspro";

$con = new mysqli($host,$user,$password,$db);
if (!$con)
{
	die("Koneksi gagal:".mysqli_connect_error());
}


$dsn = 'mysql:host=localhost;dbname=db_bilspro';
$username = 'root';
$password1 = '';
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_PERSISTENT         => true, // menggunakan koneksi yang persisten
];

try {
    $pdo = new PDO($dsn, $username, $password1, $options);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
    exit;
}
?>