problems with greek characters in database

We're upgrading our support forum. Replies are currently closed. Please view our Documentation and FAQ using the menu above.

Hi, my db is set to utf8-general-ci.

The greek characters shows up correctly on site, but in db i get strange characters.

i fixed that by adding the following 2 lines in functions.php (and converted the file to be utf-8 when saving):

mysql_query(“SET CHARACTER SET ‘utf8′”);

mysql_query(“SET NAMES ‘utf8′”);

 

and to be exact: here’s the code part on the very top of the file:

 

$dbcnx = false;

 

 

function db_connect(){

global $dbcnx;

if(!$dbcnx){

$dbcnx = @mysql_pconnect(_DB_SERVER,_DB_USER,_DB_PASS); // or die(mysql_error());

mysql_query(“SET CHARACTER SET ‘utf8′”);

mysql_query(“SET NAMES ‘utf8′”);

if(!$dbcnx){

$dbcnx = mysql_connect(_DB_SERVER,_DB_USER,_DB_PASS) or die(mysql_error());

}

if(!$dbcnx || mysql_errno()){

set_error(mysql_error());

return false;

}

mysql_select_db(_DB_NAME,$dbcnx);

query(“SET @@SESSION.sql_mode = ””);

}

return $dbcnx;

}

 

this solved the issue site wide, the greek chars shows perfect on db.

 

Thank you very much for providing this information.

np dtbaker, soon i will make a greek translation using the google translate api and i ll send u the file.

The forum ‘General Support’ is closed to new topics and replies.

predatorkillproblems with greek characters in database