18 lines
500 B
PHP
18 lines
500 B
PHP
<?php
|
|
require 'db/config.php';
|
|
try {
|
|
$pdo = db();
|
|
$stmt = $pdo->query("SHOW TABLES");
|
|
$tables = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
|
foreach ($tables as $table) {
|
|
echo "Table: $table\n";
|
|
$stmt2 = $pdo->query("DESCRIBE `$table`");
|
|
$cols = $stmt2->fetchAll(PDO::FETCH_ASSOC);
|
|
foreach ($cols as $col) {
|
|
echo " - " . $col['Field'] . " (" . $col['Type'] . ")\n";
|
|
}
|
|
}
|
|
} catch (Exception $e) {
|
|
echo "Error: " . $e->getMessage();
|
|
}
|