<?php
include 'db.php';

try {
    echo "Struktur tabel peminjaman:\n";
    echo "==========================\n";
    
    $columns = $db->query("PRAGMA table_info(peminjaman)")->fetchAll();
    
    foreach ($columns as $column) {
        echo "- {$column['name']} ({$column['type']}) ";
        if ($column['notnull']) echo "NOT NULL ";
        if ($column['pk']) echo "PRIMARY KEY ";
        echo "\n";
    }
    
    echo "\nTotal kolom: " . count($columns) . "\n";
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>
