Live verification of dbconfig.php credentials & connectivity
// 1. Include database configuration require_once __DIR__ . '/dbconfig.php'; // 2. Check connection status if ($db_connected) { // Using PDO (Recommended) $stmt = $pdo->query("SELECT NOW() AS server_time"); $row = $stmt->fetch(); echo "Time: " . $row['server_time']; } else { echo "Error: " . $db_error; }
Both $pdo and $conn (MySQLi) are initialized in dbconfig.php and available globally across your application.