Files
crm.clientright.ru/scripts/show_table_structure.php
Fedor 01c4fe80b5 chore: snapshot current working tree changes
Save all currently accumulated repository changes as a backup snapshot for Gitea so no local work is lost.
2026-03-26 14:19:01 +03:00

47 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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();