38471-vm/check_schema.php
2026-02-20 12:42:58 +00:00

15 lines
441 B
PHP

<?php
require 'db/config.php';
$tables = ['invoices', 'invoice_items', 'pos_transactions', 'pos_items', 'payments', 'pos_payments'];
foreach ($tables as $t) {
echo "Table: $t\n";
try {
$res = db()->query("DESCRIBE $t");
while ($r = $res->fetch(PDO::FETCH_ASSOC)) {
echo " {$r['Field']} ({$r['Type']})\n";
}
} catch (Exception $e) {
echo " Error: " . $e->getMessage() . "\n";
}
}