Paul:
Search in Google for that term and you'll find tons of solutions.
Thanks for that. (I forgot to login by my user ID).
Changing the collation for all tables in a MySQL databaseJust need to use the following PHP script for changing the collation for all tables at a time:
<?php
$db = mysql_connect('localhost','DB_USER','User_Pass');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('DB_Name'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>
Make sure to substitute in the above script:
-
DB_Name with your database name;
-
DB_USER with your mysql username;
-
User_Pass with your password for the mysql user;
-
utf8-general_ci with your new collation if different;