Good,
I have a PHP file with encoding UTF-8. And the text with accents in the HTML is how it should be, but when I go to the database, there are strange characters.
Database data seen in the php file
include("connection.php");
<?php
include("connection.php");
echo "<div class='narrow-block wrapper'>
<h2>Inscrições (Federados)</h2>
<table id='table2'>
$result2 = mysqli_query($con,"SELECT * FROM registofederados");
while($row = mysqli_fetch_array($result2)){
echo "<tr>";
echo "<td>" . $row['dorsal'] . "</td>";
echo "<td>" . $row['nome'] . "</td>";
echo "<td>" . $row['bi'] . "</td>";
echo "<td>" . $row['dataNasc'] . "</td>";
echo "<td>" . $row['n_federado'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['telemovel'] . "</td>";
echo "<td>" . $row['morada'] . "</td>";
echo "<td>" . $row['local_dorsal'] . "</td>";
echo "<td>" . $row['pagamento'] . "</td>";
echo "<td>" . $row['equipa'] . "</td>";
echo "<td>" . $row['categoria'] . "km </td>";
if($row['almoco'] == 1)
echo "<td>Sim</td>";
else
echo "<td>Não</td>";
if($row['pago'] == 1)
echo "<td>Sim</td>";
else
echo "<td>Não</td>";
echo "</tr>";
}
</table>
</div>";
mysqli_close($con);
?>