MySQL Forums
Forum List  »  Full-Text Search

Re: FULLTEXT & Arabic
Posted by: Stephen Savage
Date: October 13, 2005 12:24PM

Hi Yosri,

I've just used NaviCat to convert a test table with Arabic and English fields to MySQL. It displays properly in NaviCat when I open the table. However, when I try to use PHP to read the table and create a web site I get the dreaded ??? instead of the Arabic text. I have the browser (IE 5) set to use Arial Unicode MS as the font for Arabic, have the charset to utf-8, and use utf8_decode on the Arabic field, but nothing works. Can you help me out?

Thanks,

-Steve

The PHP code is shown here:

<?
include("MyIpConn.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>The GAIA Lab Iraq Test Application</TITLE>
</HEAD>
<BODY text=#510000 vLink=#999966 aLink=#cc9933 link=#996633 bgColor=#ffffcc background=header_files/glotextb.gif>
<font face="Arial Unicode MS"></font>

<?
if ($sortby!="")
{
$sorted = " order by $sortby ";
}
$bareQuery = "select English,Arabic from architecturecomponenttypes WHERE ArchitectureComponentTypeId < 11";
$queryall = $bareQuery.$sorted;
$resultall = MYSQL_QUERY($queryall);
$numberall = mysql_Numrows($resultall);

if ($numberall==0) {

echo "No Records Found !";

}
else if ($numberall>0) {

$x=0;

?>
<h3>List of Architecture Component Types </h3>
<table border=0 cellspacing=0 cellpadding=10>
<tr>
<td><b><a href="<? echo $PHP_SELF; ?>?sortby=English">ENGLISH</a></b></td>
<td><b><a href="<? echo $PHP_SELF; ?>?sortby=Arabic">ARABIC</a></b></td>

</tr>
<?
while ($x<$numberall)
{
// Changing Background color for each alternate row
if (($x%2)==0) { $bgcolor="#DEDEBC"; } else { $bgcolor="#CCCC99"; }

// Retreiving data and putting it in local variables for each row
$English=mysql_result($resultall,$x,"English");
$Arabic=mysql_result($resultall,$x,"Arabic");
$Arabic = utf8_decode($Arabic);
?>

<tr bgcolor="<? echo $bgcolor; ?>" height=30>
<td> <? echo $English; ?> </td>
<td> <font face="Arial Unicode MS" lang="ar"> <? echo $Arabic; ?></font> </td>
</tr>
<?
$x++;
} // end while

?>
</table>
<?
} // end if numberall > 0
?>
<!--msthemeseparator--><img src="../_themes/global/glohorsa.gif" width="100%" height="10"><br>
<!--mstheme--><FONT face="Arial Unicode MS" size="1" color=#666633>
Geo-Archaeological Information Applications Lab<br>
School of Human Evolution and Social Change<br>
Box 872402<br>
Arizona State University<br>
Tempe, AZ 85287-2402<br>
Webmaster - <A HREF="mailto:shsavage@asu.edu">shsavage@asu.edu</A></FONT><br>
<!--mstheme-->
</body>
</html>

Options: ReplyQuote


Subject
Views
Written By
Posted
5414
July 31, 2005 10:07AM
2661
September 19, 2005 03:08AM
Re: FULLTEXT & Arabic
2912
October 13, 2005 12:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.