I am having an issue displaying arabic text that is stored in the DB on to the php page. the MySQL table is using Charset utf8 and Collation utf8_general_ci. In the DB is displays properly when i try retrieving it useing the following. it doesnt work.
this is the code i am using:
$conn=mysql_connect(HOSTNAME,USERNAME,PASSWORD) or die(mysql_error());
mysql_query("SET NAMES 'utf8'", $conn);
/* select default database*/
mysql_select_db(DATABASE);
$sql = "SELECT distinct(SUBSTRING_INDEX(`destination`, '-',1)) as 'country' from `ar` order by destination ASC ";
$result=mysql_query($sql);
?>
</p>
<form id="form1" name="form1" method="post" action="">
<span style=" font-weight:bold; color:#00adef; font-size:14px;">اختر البلد</span>
<select name="country" id="country">
<option value="0" selected="selected">اختر</option>
<?php while($rows=mysql_fetch_assoc($result)){?>
<option value="<?php echo base64_encode($rows['country']) ?>"><?php echo utf8_encode($rows['country']) ?></option>
<?php }
mysql_free_result($result);?>
</select>
</form>
the current output I am getting is: Ø£Ø°Ø±Ø¨ÙØ¬Ø§Ù
can anyone please advise on what to do.

New Topic/Question
Reply




MultiQuote





|