0

everyone...i have a problem in my dropdown list. He is working fine but when gets the data from Database, some special characters are not recognized. You can see in the pictures:

    <?php
include ("conexao.php");
$db = new mysqli('localhost', 'root', '', 'ocorr1');
if (!$db) {
  exit('Connect Error (' . mysqli_connect_errno() . ') '
       . mysqli_connect_error());
} 
?>
<div class="label">Select Name:</div>
<select name="nome_turma">
<option value = "">---Select---</option>
<?php
$queryusers = "SELECT `nome_turma` FROM `turma` ";
$db = mysqli_query($db, $queryusers);
while ( $d=mysqli_fetch_assoc($db)) {
echo "<option value='{".$d['nome_turma']."}'>".$d['nome_turma']."</option>";
}
?>
</select> 

image 1 image 2

tigrev
  • 67
  • 1
  • 2
  • 12

1 Answers1

0

Add header('Content-Type: text/html; charset=utf-8'); at begining of you PHP script after <?php so it looks like:

<?php
header('Content-Type: text/html; charset=utf-8');
include ("conexao.php");
....
....
....

Let me know if you have any query for the same.

Hope it will fixed you issue.

Jayesh Patel
  • 289
  • 3
  • 12
  • hello, Jayesh, i tried that but still the same issue...i will try looking for more solutions...but thank you for your response... ;) – tigrev Mar 16 '16 at 15:32