View Single Post
Old 06-10-2010, 02:35 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
list and rename all of your tables, update wp-config.php. Looks like you forgot to do the latter.

For anyone who wants to automate this, here's a sample quick 'howto' automate doing the table renaming. It's not what I'd call quality code. It is smart enough to only rename tables that start with the given specific prefix:

Code:
<?php
$oldtable="wp_";
$newtable="mywp_";
mysql_connect("localhost", "mysql_user", "mysql_password");
$result = mysql_list_tables("mydb");
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
  if (eregi("^".$oldtable, $mysql_tablename($result, $i))) {
    $table = mysql_tablename($result, $i);
    mysql_query("rename table $table to ". str_replace($oldtable, $newtable, $table))
      or die("Could not rename $table.");
    echo "Table: $table renamed";
  }
}
Remember to edit wp-config.php.
__________________

Last edited by GrouchyAdmin; 06-10-2010 at 02:38 PM..
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote