We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Добавить метод GetIndexExists($sTable, $sIndexName) для проверки есть ли указанный индекс в таблице.
GetIndexExists($sTable, $sIndexName)
The text was updated successfully, but these errors were encountered:
UPD:
проверять по имени индекса, а не по имени столбца
Sorry, something went wrong.
/** * Существует ли индекс у таблицы * * @param string $sTableName имя таблицы * @param string $sIndexName имя индекса * @param array $aConfig * @return bool */ protected function GetIndexExists($sTableName, $sIndexName, $aConfig = null) { $sTableName = str_replace('prefix_', Config::Get('db.table.prefix'), $sTableName); $sQuery = "SHOW INDEX FROM `{$sTableName}`"; if ($aRows = $this->GetConnect($aConfig)->select($sQuery)) { foreach ($aRows as $aRow) { if ($aRow['Key_name'] == $sIndexName) { return true; } } } return false; }
No branches or pull requests
Добавить метод
GetIndexExists($sTable, $sIndexName)
для проверки есть ли указанный индекс в таблице.The text was updated successfully, but these errors were encountered: