I have a data in my mysql database's table which is Biñan
. However, when I try to retrieve it using php, it showed as Bi�an
in my dropdown list.
Here is my sample code:
<?php
$query = "SELECT * from municipality";
$res = mysqli_query($conn,$query);
while($row = mysqli_fetch_assoc($res))
{
echo "<option value='".$row['m_id']."'>".$row['m_name']."</option>";
}
?>
But when I manually echo/insert the character ñ
in php/mysql it displayed as is. I have also set the charset to UTF-8
.
PROBLEM SOLVED!: I just have to replace the ñ
with ñ
in my database's table. So it shows ñ
in my website.