Created
March 11, 2012 07:51
-
-
Save willwade/2015482 to your computer and use it in GitHub Desktop.
Fix Drupal Tables collation encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// your connection | |
mysql_connect("localhost","root","root"); | |
mysql_select_db("iosaac"); | |
// 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 />"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment