chore: snapshot current working tree changes
Save all currently accumulated repository changes as a backup snapshot for Gitea so no local work is lost.
This commit is contained in:
46
scripts/show_table_structure.php
Normal file
46
scripts/show_table_structure.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Показ структуры таблицы vtiger_modcomments
|
||||
* Вызов: https://crm.clientright.ru/scripts/show_table_structure.php
|
||||
*/
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', '1');
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
chdir(dirname(__DIR__));
|
||||
require_once 'config.inc.php';
|
||||
|
||||
$mysqli = new mysqli($dbconfig['db_hostname'], $dbconfig['db_username'], $dbconfig['db_password'], $dbconfig['db_name']);
|
||||
$mysqli->set_charset('utf8');
|
||||
|
||||
if ($mysqli->connect_error) {
|
||||
die("Ошибка подключения: " . $mysqli->connect_error);
|
||||
}
|
||||
|
||||
echo "Структура таблицы vtiger_modcomments:\n";
|
||||
echo str_repeat('=', 70) . "\n\n";
|
||||
|
||||
$result = $mysqli->query("DESCRIBE vtiger_modcomments");
|
||||
|
||||
if (!$result) {
|
||||
die("Ошибка: " . $mysqli->error);
|
||||
}
|
||||
|
||||
$columns = [];
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$columns[] = $row['Field'];
|
||||
echo sprintf("%-25s %-15s %-10s %-10s %s\n",
|
||||
$row['Field'],
|
||||
$row['Type'],
|
||||
$row['Null'],
|
||||
$row['Key'],
|
||||
$row['Default'] ?? ''
|
||||
);
|
||||
}
|
||||
|
||||
echo "\n" . str_repeat('=', 70) . "\n";
|
||||
echo "Всего колонок: " . count($columns) . "\n\n";
|
||||
echo "Список колонок для INSERT:\n";
|
||||
echo implode(", ", $columns) . "\n";
|
||||
|
||||
$mysqli->close();
|
||||
Reference in New Issue
Block a user