# Solved: Hebrew Characters Not Showing In Php Through MySql



## HowdeeDoodee (Aug 26, 2004)

I am trying to display Hebrew characters in php through mysql.
I have tried changing the collation settings in phpMyAdmin.
I tried utf8_bin and utf8_unicode. In both of these attempts the Hebrew characters would not show in phpMyAdmin.
Of course, no luck either when trying to display the characters through php.

I changed to utf8_general_ci:
Now the Hebrew does show in the insert paste in window
The Hebrew does show in Sql query report window as is shown below.



> UPDATE `findthep_Comm4`.`Comm_Clarke` SET `Text` = 'The original term תהו tohu and בהו bohu, ' WHERE `Comm_Clarke`.`Index` =1 LIMIT 1 ;


When I call the record up in php, all I get are question marks.

Here is the php code.


```
<?php
//script under development for Commentary Project
// Quote variable to make safe
function quote_smart($SeeAlso)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$SeeAlso = stripslashes($SeeAlso);
}
// Quote if not a number or a numeric string
if (!is_numeric($value)) {
$SeeAlso = "'" . mysql_real_escape_string($SeeAlso) . "'";
}
return $SeeAlso;
}

if(empty($MTH) && empty($RWP) && empty($SCR) && empty($STD) && empty($VWS) && empty($WES) && empty($ACL) && empty($BRC) && empty($BRN)  && empty($CAL)  && empty($DAR)  && empty($GBT)  && empty($GIL)  && empty($JFB)  && empty($KDC)) 
               // {
                // header("location: errorpage.php"); 
               // exit; 
                // } 

$MTH1 = $_GET['MTH'];
$RWP1 = $_GET['RWP'];
$SCR1 = $_GET['SCR'];
$STD1 = $_GET['STD'];
$VWS1 = $_GET['VWS'];
$WES1 = $_GET['WES'];
$ACL1 = $_GET['ACL'];
$BRC1 = $_GET['BRC'];
$BRN1 = $_GET['BRN'];
$CAL1 = $_GET['CAL'];
$DAR1 = $_GET['DAR'];
$GBT1 = $_GET['GBT'];
$GIL1 = $_GET['GIL'];
$JFB1 = $_GET['JFB'];
$KDC1 = $_GET['KDC'];


$SeeAlso = $_GET['SeeAlso'];
$username = "___";
$password = "___";
$hostname = "localhost";  
$dbh = mysql_connect($hostname, $username, $password) 
    or die("Unable to connect to MySQL");    
$dbname = "findthep_Comm4";
mysql_select_db($dbname, $dbh); 
  if(!empty($ACL1)){
  $ACL = "'ACL'";
   }
   else
   {
   $ACL = "''";
   }
 
$query = "SELECT * FROM `Comm_Clarke` WHERE `VerseRef` LIKE '%$SeeAlso%' AND `Source` = $ACL ORDER BY `Index` ASC";
```
The field containing the question marks is a field called Text. To be brief I have left out a lot of code between the above segment and the following segment.


```
$Source="Source";
    $VerseRef="VerseRef";
    $Text="Text";
    while(list($Source, $VerseRef,$Text)= mysql_fetch_row($result2))
```
Thank you in advance for any replies


----------



## HowdeeDoodee (Aug 26, 2004)

I have solved this problem for me but I am not sure about what others see on their machine.

I changed the collation to the text field with the Hebrew characters to collation = utf8_bin

I inserted the following line above the php code.


```
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8-i">
```
When I loaded the web page with Hebrew characters, I received a message to insert the XPHome disc and install the Hebrew language pack/character set from the install disc. Therefore, I installed the Hebrew language pack.

For me on my machine, I can now see the Hebrew characters in the php page.

http://www.findthepower.net/CP/CommentaryP...eAlso=Gen 1:1

Thank you in advance.


----------

