<?php
require_once 'db/config.php';
$pdo = db();

$tables = ['drugs', 'suppliers', 'visit_prescriptions'];

foreach ($tables as $table) {
    echo "--- Table: $table ---
";
    try {
        $stmt = $pdo->query("DESCRIBE $table");
        $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
        foreach ($columns as $col) {
            echo "{$col['Field']} ({$col['Type']})
";
        }
    } catch (PDOException $e) {
        echo "Error describing $table: " . $e->getMessage() . "
";
    }
    echo "
";
}

