I have a dynamic list code that works just fine. My only problem now is that I have put some values in my db using greek chars.
But when I open my page instead of getting the greek chars I get sympols like “?????”
My index.php is set to utf-8 as well as my db.
Is there something else I can do?
<?php
$sql = mysql_query("SELECT * FROM clients WHERE Category='Deksioseis' ORDER BY percentage DESC");
$productCount = mysql_num_rows($sql);
// count the output amount
if ($productCount > 0) {
$i=0;
$dynamicListDeks = '<table id="pl_list" class="list">';
while($row = mysql_fetch_array($sql)) {
$id = $row["ID"];
$aa = $row["AA"];
$client_name = $row["Client_Name"];
$details = $row["Details"];
$percent = $row["Percentage"];
$dynamicListDeks .= ($i==0) ? '<tr>' : '';
$dynamicListDeks .= <<<HD
<td class="lst_a">$aa</td>
<td class="lst_l">
<img src="../rooms/{$client_name}_logo.jpg" alt="$client_name" />
</td>
<td class="lst_b">$client_name</td>
<td class="lst_d">$details</td>
<td class="lst_c">$percent%<br /></td>
HD;
$dynamicListDeks .= ($i==1) ? '</tr>' : '';
$i++;
($i==2) ? $i = 0: '';
}
$dynamicListDeks .= '</table>';
} else {
$dynamicListDeks = "";
}
mysql_close();
?>
What you really should do, is switch to mysqli or PDO, but to solve your current problem, my guess would be you would have to set your database connection to utf8, right after you select the database: