i need share some tutor about how to Mass convert mymsql table charset collation
example : Convert / change charset UTF-8 Collate to charset Latin 1 or ISO-8951-1 this it's will be change Mass
1. Open notepad and paste this script save with name wtf you need
ex: charset.php
see the red ...what default charset you need
thanks
example : Convert / change charset UTF-8 Collate to charset Latin 1 or ISO-8951-1 this it's will be change Mass
1. Open notepad and paste this script save with name wtf you need
ex: charset.php
PHP:
<?php
// Database info
$dbhost = 'localhost';
$dbuser = 'your DB User here';
$dbpass = 'Your DB PAss here'
$dbname = 'Your DB Name Here';
//---------------
header('Content-type: text/plain');
$dbconn = mysql_connect($dbhost, $dbuser, $dbpass) or die( mysql_error() );
$db = mysql_select_db($dbname) or die( mysql_error() );
$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 latin1 COLLATE latin1_general_ci";
mysql_query($sql) or die( mysql_error() );
print "$table changed to iso-8859-1.\n";
}
mysql_close($dbconn);
?>
see the red ...what default charset you need
thanks