add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php // phpcs:ignoreFile
require __DIR__ . '/../includes/db.php';
try {
$db = controls_db_connect();
echo "Connected to MySQL successfully.\n";
$table = 'control_write_log';
if ($argc > 1 && is_string($argv[1]) && $argv[1] !== '') {
$table = $argv[1];
}
$tableEscaped = $db->real_escape_string($table);
$check = $db->query("SHOW TABLES LIKE '" . $tableEscaped . "'");
if (!$check) {
echo "SHOW TABLES query failed.\n";
}
$exists = $check && $check->num_rows > 0;
if ($exists) {
echo "Table '{$table}' exists.\n";
} else {
echo "Table '{$table}' does not exist.\n";
}
if ($exists) {
$columns = $db->query('SHOW COLUMNS FROM `' . $tableEscaped . '`');
if ($columns) {
echo "Columns:\n";
while ($column = $columns->fetch_assoc()) {
echo ' - ' . ($column['Field'] ?? '(unknown)') . "\n";
}
}
}
} catch (Throwable $exception) {
echo 'Error: ' . $exception->getMessage() . "\n";
}