• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/database.php
  • Класс: CAllDatabase
  • Вызов: CAllDatabase::RunSQLBatch
public function RunSQLBatch($filepath)
{
	if(!file_exists($filepath) || !is_file($filepath))
	{
		return array("File $filepath is not found.");
	}

	$arErr = array();
	$contents = file_get_contents($filepath);

	$this->Doconnect();
	foreach($this->connection->parseSqlBatch($contents) as $strSql)
	{
		if(!$this->Query($strSql, true))
		{
			$arErr[] = "
Query:n".$strSql."nnError:n".$this->GetErrorMessage()."
"; } } if(!empty($arErr)) { return $arErr; } return false; }