If you need to change mysql tables prefix just run the script below:
<?php
$a = ''; // here goes old current prefix
$b = ''; // here goes a new prefix
$result = db_query("SHOW TABLES");
while ($r = db_fetch_array($result)) {
$table_old = current($r);
$table_new = str_replace($a, $b, $table_old);
db_query("RENAME TABLE {$table_old} TO {$table_new}");
print "{$table_old} —> {$table_new}
";
}
?>
Of course you need to have mysql connection established at first.
Post new comment