如果来自php mysql的记录有'ñ',如何在html中输出? [重复]

This question already has an answer here:

I have a list of records but let's take this for example

John Kenneth Lorenz Minnie Niño

When i process a Select query to give me all names, it does but the last record shows Ni�o instead of Niño. How should i do it?

</div>

you must set the mysql connection charset when building a mysql connection :

$conn = mysql_connect($server, $username, $password);
mysql_set_charset("UTF8", $conn);