36 lines
727 B
PHP
36 lines
727 B
PHP
<?php
|
|
|
|
include "db.php";
|
|
|
|
$query = "SHOW tables";
|
|
$tableSet = db_query($query);
|
|
|
|
while ($row = db_fetch_array($tableSet)) {
|
|
$tableName = $row[0];
|
|
|
|
$query = "SHOW columns FROM $tableName";
|
|
$results = db_query($query);
|
|
|
|
$tablePrinted = false;
|
|
|
|
while ($row = db_fetch_array($results)) {
|
|
// print_r($row);
|
|
$colName = $row[0];
|
|
$colType = $row[1];
|
|
$colDefault = $row[4];
|
|
|
|
// echo("$colName - $colType\n");
|
|
|
|
if (strpos($colType, 'enum') === 0) {
|
|
if (!$tablePrinted) echo("\n$tableName\n");
|
|
$tablePrinted = true;
|
|
|
|
if ($colDefault == '') $colDefault = "********";
|
|
printf(" - %-35s %-90s %s\n", $colName, $colType, $colDefault);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
?>
|