<?php
// Database configuration
$db_host = 'localhost';
$db_name = 'digitalb_beaccurate';
$db_user = 'digitalb_beaccurate';
$db_pass = 'Saiful.1633';

// Table configurations
$tables = [
    'metadata' => 'MetaData',
    'products' => 'Products',
    'categories' => 'Products_Category',
    'product_requests' => 'Products_Req'
];

try {
    // Create PDO connection with UTF-8 charset
    $pdo = new PDO("mysql:host=$db_host;dbname=$db_name;charset=utf8mb4", $db_user, $db_pass);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    
    // Set connection charset to UTF-8
    $pdo->exec("SET NAMES utf8mb4");
    $pdo->exec("SET CHARACTER SET utf8mb4");
    $pdo->exec("SET character_set_connection=utf8mb4");
    
    // For backward compatibility
    $conn = $pdo;
} catch(PDOException $e) {
    die("Connection failed: " . $e->getMessage());
}
?> 