36459-vm/db_config.php
2026-05-27 14:29:58 +05:30

22 lines
509 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// db_config.php Common DB connection for RS Learning Lab
$db_host = "localhost";
$db_name = "rs_lab"; // ✅ CONFIRMED DB NAME
$db_user = "root";
$db_pass = "";
try {
$pdo = new PDO(
"mysql:host=$db_host;dbname=$db_name;charset=utf8mb4",
$db_user,
$db_pass,
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]
);
} catch (PDOException $e) {
die("DB connection failed");
}