Quantcast
Channel: What web developer needs? » MySQL
Viewing all articles
Browse latest Browse all 3

A script to change all tables and fields to the utf-8-bin collation in MYSQL

$
0
0

Method 1 ———————————– <?php // your connection mysql_connect(“localhost”,”root”,”***”); mysql_select_db(“db”); // 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 />”; } […]

The post A script to change all tables and fields to the utf-8-bin collation in MYSQL appeared first on What web developer needs?.


Viewing all articles
Browse latest Browse all 3

Trending Articles