• Модуль: perfmon
  • Путь к файлу: ~/bitrix/modules/perfmon/classes/general/query_stat.php
  • Класс: CPerfQueryStat
  • Вызов: CPerfQueryStat::GetTableColumns
static function GetTableColumns($table)
{
	global $DB;
	static $cache = array();
	$table = trim($table, "`");

	if (!array_key_exists($table, $cache))
	{
		$strSql = "SHOW COLUMNS FROM `".$DB->ForSQL($table)."`";
		$rs = $DB->Query($strSql);

		$arResult = array();
		while ($ar = $rs->Fetch())
			$arResult[$ar["Field"]] = $ar;

		$cache[$table] = $arResult;
	}
	return $cache[$table];
}