drop_index()
最后更新于:2021-11-26 03:59:50
drop_index( string$table, string$index)Drops a specified index from a table.
参数
- $table
-
(string) (Required) Database table name.
- $index
-
(string) (Required) Index name to drop.
响应
(true) True, when finished.
源文件
文件: gc-admin/includes/upgrade.php
function drop_index( $table, $index ) {
global $gcdb;
$gcdb->hide_errors();
$gcdb->query( "ALTER TABLE `$table` DROP INDEX `$index`" );
// Now we need to take out all the extra ones we may have created.
for ( $i = 0; $i < 25; $i++ ) {
$gcdb->query( "ALTER TABLE `$table` DROP INDEX `{$index}_$i`" );
}
$gcdb->show_errors();
return true;
}