How to solve the database error in Drupal

Share

Here is the code of resolving the error related to database table formate error may include

PDOException: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) …. … ..

[code]
< ?php // your connection mysql_connect("localhost","username","password"); mysql_select_db("databasename"); // 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
“;
}
}
?>
[/code]

© 2018 IT Tech Developer | XML Sitemap | HTML Sitemap
Powered by T-Developers | Designed by: Shah Rukh | Thanks to Friends
show
 
close
rss Follow on Twitter facebook linkedin youtube google+ email