Problem with Hebrew Characters in MySQL database. Hebrew characters appear as ??????.

I know this type of problem has already been posted, but I cannot store and retrieve Hebrew characters from a MySQL database.  I have read through this thread in detail, and have tried many things:

1.  Changed the character set property of the database to utf8.
2.  Changed the collation property of the database to utf8_bin.
3.  Changed the character set property of the table I need to pull data from to utf8.
4.  Changed the collation property of the tables i need to pull data from to utf8.
5.  Changed the character set property of the field that needs Hebrew characters to utf8.
6.  Changed the collation property of the field that needs Hebrew characters to utf8.

So, pretty much everything is set to utf8.  With navicat on the mac, I open up a console interface to the database.  I enter the following

mysql> show variables like "%%character%%";

and I receive this:

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+  

for the same command on navicat on my windows machine I get this when I enter the above command:

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                       |
| character_set_connection | latin1                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                       |
| character_set_server     | latin1                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+  

In my PHP script, I use this code before I query the database for the 'description' field values:

function pInfo($id, $col){

      $cxn = connect_to_db("connection.php");
      $sql = "SELECT name, title, image, description FROM frames, panels WHERE panels.FID = frames.ID AND panels.ID='$id'";
      mysql_query("SET character_set_client=utf8");
      mysql_query("SET character_set_connection=utf8");
      mysql_query("SET character_set_database=utf8");
      mysql_query("SET character_set_results=utf8");
      mysql_query("SET character_set_server=utf8");
      $result = mysql_query($sql, $cxn) or die("Couldn't retreive the panel information");
      $row = mysql_fetch_assoc($result);
      
      return stripslashes(utf8_decode($row[$col]));

}

When I echo the return value, I see ???? ???? ?? ??? in place of the Hebrew characters.  I am not sure why this is happening.  How can I ensure that I get the Hebrew characters to display on the webpage?

When I query the value for the 'description' field on navicat on the mac, I get this:

+---------------------------------------------------+
| description                                       |
+---------------------------------------------------+
| ???? ??'? ?????'? '???? ????
+---------------------------------------------------+
1 rows in set (0.26 sec)

When I query the value for the 'description' field on navicat on the windows machine, I get this;

+---------------------------------------------------+
| description                                       |
+---------------------------------------------------+
| ÜÓãÓ Óã'ç ÓÛÚÜ×'ç 'çÚÜ× ÓÛ×Ó |
+---------------------------------------------------+
1 rows in set (0.26 sec)

Why???  What is going on!?

How can I ensure that when I insert and pull data from this field, that it displays the Hebrew characters on my browser?

Thank you for your time and help!
LVL 4
ariestavAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin CrossChief Technology OfficerCommented:
http://giladlotan.com/blog/?p=270

See the above and see if it helps you as think the issue is in the storing from and displaying of the characters on the PHP side.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kevin CrossChief Technology OfficerCommented:
Note the use of utf8_bin on database fields to accept hebrew characters.
0
ariestavAuthor Commented:
Thanks for the link.  I took a look at that blog posting in my troubleshooting, and tried it, but the steps didn't seem to help because I am populating the database via navicat.  I don't think it has to do with the PHP side of things because when I query the actual db in navicat's console window on my windows box, I get the ????? pattern.  
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

khr2003Commented:
Try to use latin1 instead of utf8. Alternatively, why don't insert the characters as html values. This way no matter what the encoding is you will be able to read them.
0
ariestavAuthor Commented:
@khr:  use latin1 for which character set variable?  All of them?  Some of them, etc. . .

Thanks!
0
khr2003Commented:
when you create the database through phpmyadmin, chose the name and next to it you will find the collation menu, chose latin1
0
khr2003Commented:
Sorry, I forgot to mention I never used navicat, but I guess it will be the same as phpmyadmin you will need to define the collation of the database before creating it. So chose latin1 when you create the database
0
NerdsOfTechTechnology ScientistCommented:
0
NerdsOfTechTechnology ScientistCommented:
Try doing this before the query
mysql_query("SET NAMES 'hebrew'");
0
NerdsOfTechTechnology ScientistCommented:
try setting your headers for your html output for hebrew?
meta http-equiv=Content-Type content=text/html; charset=UTF-8
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.