A WordPress-centric search engine for devs and theme authors



add_clean_index ›

Since1.0.1
Deprecatedn/a
add_clean_index ( $table, $index )
Parameters: (2)
  • (string) $table Database table name.
    Required: Yes
  • (string) $index Database table index column.
    Required: Yes
Returns:
  • (true) True, when done with execution.
Defined at:
Codex:

Adds an index to a specified table.



Source

function add_clean_index( $table, $index ) {
	global $wpdb;
	drop_index( $table, $index );
	$wpdb->query( "ALTER TABLE `$table` ADD INDEX ( `$index` )" );
	return true;
}