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

$db = new PDO("mysql:host=$dbHost;dbname=$dbName;charset=utf8mb4", $dbUser, $dbPass);

echo "<h2>girisyapanlar Tablosu Yapısı</h2>";
echo "<style>table{border-collapse:collapse;} td,th{border:1px solid #333;padding:8px;}</style>";

$cols = $db->query("DESCRIBE girisyapanlar")->fetchAll(PDO::FETCH_ASSOC);
echo "<table><tr><th>Sütun</th><th>Tip</th></tr>";
foreach ($cols as $col) {
    echo "<tr><td>{$col['Field']}</td><td>{$col['Type']}</td></tr>";
}
echo "</table>";

echo "<h2>Örnek Veriler (son 5)</h2>";
$data = $db->query("SELECT * FROM girisyapanlar ORDER BY id DESC LIMIT 5")->fetchAll(PDO::FETCH_ASSOC);
echo "<pre>" . print_r($data, true) . "</pre>";