Corrupted character on mysql with utf-8 for CRE Loaded


Category: Other

I am using the osCommerce RC2 with Greek language utf-8.. While i was exploring in the mysql i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql were TOTALLY corrupted and that a problem..

After all i found a solution..

### open includesfunctionsdatabase.php ####
And find this :

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;

if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}

if ($$link) mysql_select_db($database);

return $$link;
}


#### And replace with this ####

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;

if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");

} else {
$$link = mysql_connect($server, $username, $password);
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");

}

if ($$link) {
mysql_select_db($database);
tep_db_query('SET time_zone='' . CONFIG_TIME_ZONE . ''');
}

return $$link;
}



Do the same for the adminincludesfunctionsdatabase.php

I hope this helps some people who may have the same problems as me..

Onoufriadis Christoforos
http://www.turbosim.gr
17 July 2008

This contribution has been found on osCommerce website, but you can ask us how much would it cost to get it working with CRE Loaded

Categories

 
 

Customers says

If you need CRE customization, modification or if you are just beginning and need to get your CRE store functional so you can start selling, look no further.

Christopher Stoufflet, United States
Read all testimonials