...

View Full Version : Foreign character displaying from godaddy webhosting database



ketanco
07-03-2009, 06:43 PM
Hello,

I have web hosting with godaddy. I added another domain to my hosting account, but I am planning to make that new web page in a foreign language with some different character letters of course. For just a static html page, the foreign letters are displayed correctly. However, when I try to update mysql database with foreign characters it didnt display them correctly. Even when updating the database, it enters foreign characters wrong.

Then I went into phpmyadmin of the database and tried all sorts of things such as changing the collation of the columns to foreign characters or changing the whole database connection collation to foreign character. On top of that, as the web form updating did not enter characters properly, I even manually pasted the correct form of characters into the table in phpmyadmin. Still the website can not display the correct characters from the table.

I talked to godaddy and other than advising to change to connection collation, they said they can not hlep further and it is a scripting issue, and they said there are many foreign websites hosted with them. They said I should modify scripting in an htaccess file and they support that file type. Can anyone advise how to do that or any other advice?

mlseim
07-04-2009, 12:20 AM
Kentaco ... LOL
You're like me, "having an affair" on another forum.
I've been a part of CF much longer than WDF though.

Hopefully you'll find an answer here ...
I still don't have the answer :(

abduraooft
07-04-2009, 09:30 AM
Are you using mysql and php? Are you using unicode characters?
If so, you'd need to execute the following statement before inserting/retrieving anything to/from the DB

mysql_query("SET names='utf-8'"); Check the manual for more details, http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

ketanco
07-10-2009, 05:35 PM
:) yes msleim thats right. i am still looking for the answer.

and abduraooft yes it is php and mysql...

Here is what I did and you guys tell me what might be wrong:

(as the site needs to be in turkish, but i got many replies that utf8 also works for all the steps below...)


1-I changed the connection collation of the database to: latin5_turkish_ci

2-then I created a new table. I read from somewhere that only new tables created after this change gets affected by the change I do in #1.

3-On that new table, in php my admin, I went into operations tab and changed the collation of the table to latin5_turkish_ci (and all the columns are collated as latin5_turkish_ci)

4-I have two php files, one to update the database and the second one (lets say file2.php) shows info from the database. both files have something like this:

mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);

mysql_query("SET NAMES 'latin5_turkish_ci'");

5-in the main page file, which brings up the file2.php via a php include statement, i also have character declaration as:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>


<link rel="stylesheet" type="text/css" href="css.css" media="all"/>

<title>............</title>
<meta http-equiv="Content-Type" content="text/html; charset=latin5_turkish_ci" />


(but i dont have this in file2.php that is onnly for bringing up info from database and included in the main page...or should i ?)


So....Can anyone tell me what is wrong here? I even tried manually updating the database with correct characters in phpmyadmin...still it doesnt work...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum