<?php
$conn = new mysqli("localhost", "digupdog_FEEDadmin", "SENHA", "information_schema");

$db = "digupdog_vibeeo";
$res = $conn->query("
    SELECT TABLE_NAME, COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_KEY
    FROM COLUMNS WHERE TABLE_SCHEMA = '$db'
    ORDER BY TABLE_NAME, ORDINAL_POSITION
");

$out = "";
while ($row = $res->fetch_assoc()) {
    $out .= implode("\t", $row) . "\n";
}

file_put_contents("schema_vibeeo.txt", $out);
echo "Arquivo gerado: schema_vibeeo.txt";
?>
