473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Charset problem, Data from mysql appear wrongly

Hello
I have build an application with php/mysql on my localhost Windows XP
(english)
My application lets you select the language which at the moment is
Greek and English.
My application is working fine on both languages but when i uploaded
it to a remote server greek doesn't work. Actually the greek that are
stored in the DB come up wrongly.

I have read many other posts regarding this problem and i have tried
many things but none works.

First of all, i have checked that both mysql servers have the same
character_set and character_set variables, so the remote DB supports
Greek.

Here is the code that initializes the DBConnection

$DBLink = mysql_connect($DBHostIP,$DBUserName,$DBPassword)
or die ("Could not connect on MySql Database");
mysql_select_db("sarafian_Agenda") or die("Could not select
database");

which resides in a function.
This was the original code with which only on my server worked in
conjuction with the correct character set in the header part of the
produced html

Having read some articles i decided to try this code in the function

$DBLink = mysql_connect($DBHostIP,$DBUserName,$DBPassword)
or die ("Could not connect on MySql Database");
mysql_select_db("sarafian_Agenda") or die("Could not select
database");

mysql_query("SET NAMES 'iso-8859-7'",$DBLink);
ini_set('mbstring.internal_encoding','iso-8859-7');
ini_set('mbstring.http_input','iso-8859-7');
ini_set('mbstring.http_output','iso-8859-7');
ini_set('mbstring.internal_encoding','iso-8859-7');
header("Content-type: text/html;charset=iso-8859-7");

iso-8859-7 is the charcter set for greek.

I have tried various combinations for the iso-8859-7 with utf-8 but i
had no luck.

I really cant understand the problem. The curious thing is that
phpMyAdmin presents the data correctly.
I have tried tracking down how it does it without succes. Both
databases are above the 40010 version that phpadmin checks.

Thank you very much
Jul 17 '05 #1
0 1354

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ka | last post by:
I install a mysql server in default installation with latin charset, but I want to use GBK(a chinese charset), so that I can store and search chinese words directly. so, I download, unpack and...
0
by: Anil Garg | last post by:
Hi, I am trying to install myql on redhat. mysql package used: mysql-3.23.52-unknown-freebsdelf4.6-i386.tar.gz While following the instructions in install document..when i run the follwing...
1
by: Konstantin Kivi | last post by:
I cannot get koi8r charset working propely after I tried to switch from 4.0.x In 4.0 I have server running with --default-character-set=koi8_ru and both mysql client and servlet application did...
0
by: Wouter | last post by:
Hi, I use Windows XP, Apache2 and MySQL 4.1. I changed my default charset by adding in my php.ini: default-character-set=utf8 Some row inserts now went wrong, so I did remove it again....
0
by: | last post by:
I work with MySQL/PHP/Apache many years. I am Greek so, in many pages, I use Greek language. the problem is this: I have 2 group of programs with different interaction: group 1: PHP, MySQL...
3
by: snowweb | last post by:
I'm creating my first web application in PHP/MySQL, however, when I go to view the database contents, the data has been stored in the wrong columns. I've gone through my insertion code with a fine...
0
by: Joachim | last post by:
Environment: Windows XP - german settings. MySQL: 5.0.18-nt Database charsets have been changed from 'latin1' (where 'LOAD DATA' worked fine) to utf-8 to resolve some charset issues with...
0
by: cappa | last post by:
hi, i've some problem to print to screen and save date in mysql if the entries contain char like à,è... i try to read some post but i'm not able to solve my problem. i use easyphp 1.8 with...
8
by: Stefano Sabatini | last post by:
Hi all, I'm encountering this while trying to implement a factory singleton method to generate objects. The singleton has a static map which binds a static creation function defined in each...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.