From 75ca19864eceaf5c8c706d16ee11559c548347d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 25 Aug 2007 05:28:10 +0100 Subject: remove mysql SET CHARACTER SET call --- mysql_convert_unicode.php | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 mysql_convert_unicode.php (limited to 'mysql_convert_unicode.php') diff --git a/mysql_convert_unicode.php b/mysql_convert_unicode.php new file mode 100644 index 000000000..dfc833b44 --- /dev/null +++ b/mysql_convert_unicode.php @@ -0,0 +1,112 @@ + + + + +MySQL Charset Converter + + + + + + + + + + + +

+ + + + "; + + } else if (!$op) { + + print_warning(__("Please backup your database before proceeding.")); + + print "

" . __("This script will convert your Tiny Tiny RSS database to UTF-8. + Depending on current database charset you may experience data corruption (lost accent characters, etc.). + After update, you'll have to set MYSQL_CHARSET option in config.php to 'utf8'.") . "

"; + + print "
+ + +
"; + + } else if ($op == "do") { + + print "

".__("Converting database...")."

"; + + db_query($link, "SET FOREIGN_KEY_CHECKS=0"); + + $result = db_query($link, "SHOW TABLES LIKE 'ttrss%'"); + + while ($line = db_fetch_assoc($result)) { + $vals = array_values($line); + $table = $vals[0]; + + $query = "ALTER TABLE $table CONVERT TO + CHARACTER SET 'utf8'"; + + print "

$query

"; + + db_query($link, $query); + } + + db_query($link, "SET FOREIGN_KEY_CHECKS=1"); + + print "
+ +
"; + + } + +?> + + + + -- cgit v1.2.3