php+mysql页面乱码问题
一个很小的留言板程序
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $mysql_server_name = "localhost"; $mysql_username = "root"; $mysql_password = "123456"; $mysql_database = "gbook"; $sql = "SELECT * FROM gbook ORDER BY 'id' DESC"; //排序 后留言的在前面显示 $conn = mysql_connect($mysql_server_name,$mysql_username,$mysql_password); mysql_select_db($mysql_database,$conn); $result = mysql_query($sql); while($row = mysql_fetch_row($result)) { // ----if语句判断男女------ if($row[2]==1) { $gender = '男';} else { $gender = '女'; } ?>
=$row[6]?> =$row[5]?> =$row[1]?>(=$gender?>) =$row[3]?> |
=nl2br($row[4])?> |