<?php
header('Content-Type: text/html; charset=utf-8');

try {
    $pdo = new PDO('mysql:host=localhost;dbname=pinheir3_controle_frotasV1.1;charset=utf8mb4', 'pinheir3_admin', '080880Gelboy');
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    
    echo "<h1>🔍 Verificando Colunas da Tabela Clientes</h1>";
    
    $stmt = $pdo->query("DESCRIBE clientes");
    $colunas = $stmt->fetchAll();
    
    echo "<table border='1' style='border-collapse: collapse;'>";
    echo "<tr><th>Campo</th><th>Tipo</th><th>Nulo</th><th>Chave</th><th>Padrão</th><th>Extra</th></tr>";
    
    foreach ($colunas as $coluna) {
        echo "<tr>";
        echo "<td>{$coluna['Field']}</td>";
        echo "<td>{$coluna['Type']}</td>";
        echo "<td>{$coluna['Null']}</td>";
        echo "<td>{$coluna['Key']}</td>";
        echo "<td>{$coluna['Default']}</td>";
        echo "<td>{$coluna['Extra']}</td>";
        echo "</tr>";
    }
    echo "</table>";
    
    echo "<h2>📋 Lista de Colunas:</h2>";
    echo "<ul>";
    foreach ($colunas as $coluna) {
        echo "<li>{$coluna['Field']} ({$coluna['Type']})</li>";
    }
    echo "</ul>";
    
} catch (Exception $e) {
    echo "<p style='color: red;'>❌ Erro: " . $e->getMessage() . "</p>";
}
?> 
