Quote:
Originally Posted by Readboy
uppppppppppppp
|
Create a file called convert.php and place the following code in it
PHP Code:
<?php
// Don't forget to enter your db infos.
define('THIS_SCRIPT', 'convert');
require './global.php';
//---------------
header('Content-type: text/plain');
$dbconn = mysql_connect('servername', 'db_user', 'db_pass') or die( mysql_error() );
mysql_select_db("db_name");
$sql = "ALTER DATABASE `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$result = mysql_query($sql) or die( mysql_error() );
print "Database changed to UTF-8.\n";
$sql = 'SHOW TABLES';
$result = mysql_query($sql) or die( mysql_error() );
while ( $row = mysql_fetch_row($result) )
{
$table = mysql_real_escape_string($row[0]);
$sql = "ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci, CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($sql) or die( mysql_error() );
print "$table changed to UTF-8.\n";
}
mysql_close($dbconn);
?>
Enter your db info accordingly and then upload the file in the root of your forum folder and run it from the browser. But first it would be best if you backed up your db.