Difference between revisions of "Change Database Collation"
From AWBS Wiki
(→Converting the Database) |
(→Converting the Database) |
||
Line 3: | Line 3: | ||
== Converting the Database == | == Converting the Database == | ||
− | < | + | <code> |
− | + | <?php | |
$DIR=(dirname(__FILE__)); | $DIR=(dirname(__FILE__)); | ||
− | |||
require($DIR."/../includes/dbconfig.php"); | require($DIR."/../includes/dbconfig.php"); | ||
− | |||
include($workdir."/includes/sessions.php"); | include($workdir."/includes/sessions.php"); | ||
− | |||
include_once($workdir."/config.php"); | include_once($workdir."/config.php"); | ||
− | |||
− | |||
$tables = mysql_list_tables($dbdatabase); | $tables = mysql_list_tables($dbdatabase); | ||
− | |||
− | |||
while (list($table) = mysql_fetch_row($tables)) { | while (list($table) = mysql_fetch_row($tables)) { | ||
− | |||
sqlwritesingle("ALTER TABLE $table CONVERT TO CHARACTER SET latin5 COLLATE latin5_turkish_ci;"); | sqlwritesingle("ALTER TABLE $table CONVERT TO CHARACTER SET latin5 COLLATE latin5_turkish_ci;"); | ||
− | |||
echo "$table - DONE<br />";flush();ob_flush(); | echo "$table - DONE<br />";flush();ob_flush(); | ||
− | |||
} | } | ||
− | + | ?> | |
− | ?></math> | + | </math> |
== Extended System Configuration == | == Extended System Configuration == | ||
== DBCONFIG.PHP Modification == | == DBCONFIG.PHP Modification == |
Revision as of 22:43, February 9, 2009
Some languages require the Database collation to be changed in order to display characters correctly. You will find instructions here on how to change your database collation and configure AWBS to work correctly with this change.
Converting the Database
<?php
$DIR=(dirname(__FILE__));
require($DIR."/../includes/dbconfig.php");
include($workdir."/includes/sessions.php");
include_once($workdir."/config.php");
$tables = mysql_list_tables($dbdatabase);
while (list($table) = mysql_fetch_row($tables)) {
sqlwritesingle("ALTER TABLE $table CONVERT TO CHARACTER SET latin5 COLLATE latin5_turkish_ci;");
echo "$table - DONE
";flush();ob_flush();
}
?>
</math>
Extended System Configuration
== DBCONFIG.PHP Modification ==