• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/mysqldbconnection.php
  • Класс: BitrixMainDBMysqlDbConnection
  • Вызов: MysqlDbConnection::isTableExists
public function isTableExists($tableName)
{
	$tableName = preg_replace("/[^A-Za-z0-9%_]+/i", "", $tableName);
	$tableName = trim($tableName);

	if (strlen($tableName) <= 0)
		return false;

	$dbResult = $this->query("SHOW TABLES LIKE '".$this->getSqlHelper()->forSql($tableName)."'");
	if ($arResult = $dbResult->fetch())
		return true;
	else
		return false;
}