Skip to content

Instantly share code, notes, and snippets.

@willwade
Created March 11, 2012 07:51
Show Gist options
  • Save willwade/2015482 to your computer and use it in GitHub Desktop.
Save willwade/2015482 to your computer and use it in GitHub Desktop.
Fix Drupal Tables collation encoding
<?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 . " =&gt; " . $table . " CONVERTED<br />";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment