38471-vm/check.php
2026-02-25 09:58:14 +00:00

18 lines
520 B
PHP

<?php
require 'db/config.php';
$db = db();
$tables = ['payments', 'purchase_payments', 'pos_payments'];
foreach ($tables as $t) {
try {
$stmt = $db->query("SHOW COLUMNS FROM `$t`");
$has = false;
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if($row['Field'] == 'outlet_id') $has = true;
}
if($has) echo "$t has outlet_id\n";
else echo "$t missing outlet_id\n";
} catch (Exception $e) {
echo "Error on $t: " . $e->getMessage() . "\n";
}
}