July 21, 2012 in Classic self-hosted technical help
If you would like to be able to change the charset of your database tables to something else here is the code
// your connection
mysql_select_db("Your Databse Name");
// convert code
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
foreach ($row as $key => $table)
mysql_query("ALTER TABLE " . $table . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci");
echo $key . " => " . $table . " CONVERTED<br />";
Make a file called tables.php or something along the line of a php file, and put it in your root folder. Copy the code and put it in that file and then fill in your DB info. When you are done run it then delete the file after it is done [it may take some time to finish depending on how many tables you have].
Change "utf8_unicode_ci" to whatever charset you want [I used unicode because it's multilangual]
This works for all databases so not only IPB based databases.
This topic is now archived and is closed to further replies.
Started 1 hour ago
Leon de Graaff
Started 21 hours ago
Started September 9