Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 08:55:49 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155482 Posts in 21708 Topics by 7733 Members
Latest Member: himagain
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Problem with national character after migration db to another server  (Read 556 times)
puschpull

Offline Offline

Posts: 5



WWW
« on: March 18, 2009, 10:18:35 AM »

Hello, i have problem:
this image ilustrated the problem:

http://puschpull.org/root/a/local_web.png
http://puschpull.org/root/a/local_data.png
http://puschpull.org/root/a/server_web.png
http://puschpull.org/root/a/server_data.png

http://puschpull.org/root/a/konzole_vypis_stavu_mysql_localhost.png

http://puschpull.org/root/a/phpmyadmin_localhost_tabulky_pred_exportem.png
http://puschpull.org/root/a/phpmyadmin_webserver_tabulky_wsb_po_importu.png

my problem is (maybe) like:
http://www.websitebaker2.org/forum/index.php/topic,5653.0.html
http://www.websitebaker2.org/forum/index.php/topic,6215.0.html

my trouble have 5-6 days and i not this repair
sad(

my language is czech, and utf-8
my site with this problem after migration:
http://puschpull.org/test_aimon/pages/sluzby/reference.php

Please Help me !!
smiley



Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #1 on: March 19, 2009, 09:26:51 PM »

Export / Import incompatibility ... check the export DB, maybe re-export and then do the import again.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

puschpull

Offline Offline

Posts: 5



WWW
« Reply #2 on: March 20, 2009, 11:46:33 PM »

Problem is now OK !!

 this script:
websitebaker\framework\class.database.php
edit

// Connect to the database
function connect() {
$status = $this->db_handle = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
if(mysql_error()) {
$this->connected = false;
$this->error = mysql_error();
} else {
if(!mysql_select_db(DB_NAME)) {
$this->connected = false;
$this->error = mysql_error();
} else {
$this->connected = true;
}
}
return $this->connected;
}



and instert one line:


// Connect to the database
function connect() {
$status = $this->db_handle = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
if(mysql_error()) {
$this->connected = false;
$this->error = mysql_error();
} else {
if(!mysql_select_db(DB_NAME)) {
$this->connected = false;
$this->error = mysql_error();
} else {
mysql_query("SET NAMES utf8");
$this->connected = true;
}
}
return $this->connected;
}



now works all character perfect !
« Last Edit: March 20, 2009, 11:48:45 PM by puschpull » Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #3 on: March 21, 2009, 11:51:10 AM »

... and with the next update of WebsiteBaker this change will be gone ... The permanent solution to your issue is a proper export/import of your Database.

Also, this won't work for everybody, since lot's of servers work with local character settings which are incompatible.

A note on the sde: Please use the "Codefunction" in the forum to highlicht code. You find this function hiddden in the "#" button, second row of icons, the third from the left.

cheers

Klaus
« Last Edit: March 21, 2009, 11:53:40 AM by kweitzel » Logged

WebsiteBaker Org e.V. - for WebsiteBaker

puschpull

Offline Offline

Posts: 5



WWW
« Reply #4 on: March 21, 2009, 12:57:11 PM »

how i make highlight  one line in "code"?

Code:
// Connect to the database
function connect() {
$status = $this->db_handle = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
if(mysql_error()) {
$this->connected = false;
$this->error = mysql_error();
} else {
if(!mysql_select_db(DB_NAME)) {
$this->connected = false;
$this->error = mysql_error();
} else {
mysql_query("SET NAMES utf8");
$this->connected = true;
}
}
return $this->connected;
}
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #5 on: March 21, 2009, 09:31:25 PM »

I see what you mean, you could use the "quote" function like this:

Quote
// Connect to the database
function connect() {
$status = $this->db_handle = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
if(mysql_error()) {
$this->connected = false;
$this->error = mysql_error();
} else {
if(!mysql_select_db(DB_NAME)) {
$this->connected = false;
$this->error = mysql_error(); 
} else {

mysql_query("SET NAMES utf8");  // this line was added!

$this->connected = true;
}
}
return $this->connected;
}


cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

puschpull

Offline Offline

Posts: 5



WWW
« Reply #6 on: March 23, 2009, 10:42:18 AM »

Thanks!
smiley
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!