View Full Version : How to convert charset ?
Readboy
07-30-2010, 08:34 AM
i want convert charset of my forum but in vb4, mod convert not working.
Pls tell me how to convert charset vb4 , iso => utf8 ?
--------------- Added 1280495344 at 1280495344 ---------------
nobody can help me ?
--------------- Added 1280505578 at 1280505578 ---------------
nobody can help me ?
--------------- Added 1280550184 at 1280550184 ---------------
help meeeeeeeeeee
Readboy
08-01-2010, 01:15 AM
upppppppppppppppppppppppppppppppppppp
Readboy
08-02-2010, 02:07 PM
uppppppppppppp
borbole
08-02-2010, 02:25 PM
uppppppppppppp
Create a file called convert.php and place the following code in it
<?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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.