You appear to be a bot. Output may be restricted
Description
Convert tables from one engine to anotherWe assume that the WordPress user has the authority to alter tables
Usage
OIK_innodb::convert_engine( $from_engine, $to_engine );
Parameters
- $from_engine
- ( string ) optional default: MyISAM –
- $to_engine
- ( string ) optional default: INNODB –
Returns
voidSource
File name: oik-batch/class-oik-innodb.phpLines:
1 to 12 of 12
function convert_engine( $from_engine="MyISAM", $to_engine="INNODB" ) { global $wpdb; foreach ( $this->results as $result ) { if ( $from_engine == $result->engine ) { //$query = $wpdb->prepare( "ALTER TABLE %s engine=%s", DB_NAME . "." . $result->table_name, $to_engine ); $query = sprintf( "ALTER TABLE %s engine=%s", $result->table_name, $to_engine ); echo $query; echo PHP_EOL; $rows_affected = $wpdb->query( $query ); } } }View on GitHub