tags:

views:

30

answers:

1

Hi all,

My question in brief here:

The site is developed with PHP as front end and mysql as backend.

I am registering in my site by entering the arabic letters. And the value also inserted in mysql database. But it is not in the format what i entered. It looks like junk words.

Now my problem is when i try to login i can't able to match the input what i entered. I am stuck with this place.

Any ideas or suggestion will be helpful and grateful.

thanks in advance..

+1  A: 

This problem should be solved in an earlier stage. Arabic character do not fit in a non-unicode databasetable. That's the real problem.

You should use Unicode tables as well as a Unicode connection to your MySQL database.

Set the default character set of your table to utf8 and make sure the connection to your database is also using this character set:

$conn = mysql_connect($server, $username, $password);
mysql_set_charset("UTF8", $conn);

See also: http://nl3.php.net/manual/en/function.mysql-set-charset.php

Check the character set of your current connection with:

echo mysql_client_encoding($conn);

See also: http://nl3.php.net/manual/en/function.mysql-client-encoding.php

When creating your tables do something like this:

create table user (
    // Your table definition
) default charset = UTF8

If you have done these things and add a user which contains arabic character to your table, you will see it is displayed correct. Now the comparison will be easy.

Good luck!

Stegeman