Page 1 of 1

encoding problem in mysql database

PostPosted: 29. November 2008 13:59
by cmf_334
Dear Sir,
Can anyone tell me how can i set default_character_set = ut8 to my.cnf file?
i set this character setttings to my.ini via mysqldadmin but this is not working .
i am facing this problem for arabic characters. i see in my .php file the arabic charactes as ??????.

please try to reply to me as early as possilble.

Regards,
Faruk Chowdhury.

PostPosted: 29. November 2008 14:05
by Wiedmann
Can anyone tell me how can i set default_character_set = ut8 to my.cnf file?

Open the file my.cnf (\xampp\mysql\bin) with a texteditor and change/add the settings you need. Restart MySQL.

PostPosted: 29. November 2008 14:29
by cmf_334
Thanx for your quick response

How can i open \xampp\mysql\bin\my.cnf file. because when right clicked on this file there only OPEN option comes and after clicking on this nothing is open.
it seem to as a my SpeedDial shortcut .
so please tell me how can edit this file.

Regards,
Faruk Chowhury.

PostPosted: 29. November 2008 15:16
by Wiedmann
How can i open \xampp\mysql\bin\my.cnf file.

Drag 'n drop the file in your texteditor.
Or use the menu "File -> Open" in your texteditor.

PostPosted: 29. November 2008 18:27
by cmf_334
Wiedmann wrote:
How can i open \xampp\mysql\bin\my.cnf file.

Drag 'n drop the file in your texteditor.
Or use the menu "File -> Open" in your texteditor.


Thank you for your response.
now i can edit the\xammp\mysql\bin\ my.cnf according to your drag and drop method.
i added default-character-set = utf8 and
also in \xammp\apache\bin\php.ini with
default_charset = "UTF-8" then restarted the servers.

But still i can't see the arabic charcters. it comes like as ??????.
so can you tell me where is the problem?

Regards,
faruk chowdhury

PostPosted: 29. November 2008 19:36
by Wiedmann
so can you tell me where is the problem?

- wrong data in MySQL (you can verify this with e.g. phpMyAdmin)
- and/or data is stored with a wrong charset in MySQL (you can verify this with e.g. phpMyAdmin)
- and/or your PHP script is using a wrong charset for the connection
- and/or the html page set a wrong charset

Re: encoding problem in mysql database

PostPosted: 14. December 2008 07:46
by cmf_334
Dear Sir,
Thank you for your reply.
i am using apache 1.3.33 - php 4.3.10 - mysql 4.1.9.
now i want to use update apache php and mysql versions via XAMMP.
when i am storing data in updated mysql database i can't see arabic characters for previous data. but for new data this is not making any problem.
i checked via phpmyadmin and i see that it shows the arabice characters properly but in my php scripts it does not show properly.i am using ajax technique to view data.
i set configuration in php ,mysql and html pages like as:

1.default_charset = "UTF-8"[php.ini]
2.[im my.ini]

[mysqld]

datadir=${path}/mysql/data
basedir=${path}/mysql
bind-address=127.0.0.1
; Uncomment for use on USB key
; skip-innodb
default-character-set=utf8
[client]
default-character-set=utf8
3.
[in html/php pages]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

so can you tell me how can i fix this problem?

Thanks in advance.

Regards,
Faruk Chowdhury.