����JFIF��`�`�����Viewing File: /home/u820193700/domains/spiti2026im.in/public_html/debug_db.php
<?php
// debug_db.php - Comprehensive diagnostic tool
error_reporting(E_ALL);
ini_set('display_errors', 1);

header('Content-Type: text/plain');

echo "--- Spiti 2026 Database Diagnostics ---\n\n";

// 1. Check if db_connect.php exists
if (!file_exists('api/db_connect.php')) {
    die("ERROR: api/db_connect.php not found.\n");
}
echo "✓ api/db_connect.php exists.\n";

// 2. Attempt connection
try {
    require_once 'api/db_connect.php';
    echo "✓ Database connection SUCCESSFUL.\n";
    echo "Host info: " . $pdo->getAttribute(PDO::ATTR_CONNECTION_STATUS) . "\n\n";
} catch (Exception $e) {
    die("X CONNECTION FAILED: " . $e->getMessage() . "\n\n" . 
        "Double check your HOST, DBNAME, USER, and PASS in api/db_connect.php.\n" .
        "Current settings in file:\n" .
        file_get_contents('api/db_connect.php'));
}

// 3. Check Tables
$tables = ['admins', 'registrations', 'interests', 'qa', 'hotels', 'contacts', 'gallery'];
echo "--- Table Check ---\n";
foreach ($tables as $table) {
    try {
        $stmt = $pdo->query("SELECT COUNT(*) FROM `$table` ");
        $count = $stmt->fetchColumn();
        echo "✓ Table '$table': EXISTS ($count records)\n";
    } catch (Exception $e) {
        echo "X Table '$table': MISSING or Error: " . $e->getMessage() . "\n";
    }
}

echo "\n--- PHP Environment ---\n";
echo "PHP Version: " . PHP_VERSION . "\n";
echo "Server Software: " . $_SERVER['SERVER_SOFTWARE'] . "\n";
echo "Document Root: " . $_SERVER['DOCUMENT_ROOT'] . "\n";
?>
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����