我在php中有一个select框,它从mysql检索数据,但是带有重音符号的数据用特殊字符显示。在我添加选择框之前,一切都很好。我该怎么修?
这是我的密码:
<html>
<head>
<meta charset="utf-8">
<!-- importer le fichier de style -->
<link rel="stylesheet" href="Style/style1.css" media="screen" type="text/css" />
<title>Ajouter un Scanner </title>
<body>
<div id="container">
<!-- zone de connexion -->
<form action ="insert.php" method="post">
<h1>Ajout d'un Scanner</h1>
<label><b>Catégorie</b></label><br>
<?php
$mysqli = new mysqli("localhost", "root", "", "mapbdd") or die($this->mysqli->error);
$query = $mysqli->query("SELECT icone_categorie FROM markers_icone");
//$result = mysqli_query($query);
?>
<select name="select_categorie" id='select_categorie'type="List" >
<option value="-1"></option>
<?php
while($row = $query->fetch_array(MYSQLI_ASSOC)){
echo "<option>{$row['icone_categorie']}</option>";
}
?>
</select>
<br><br>
<label><b>Ville</b></label>
<input type="text" placeholder="Entrer la ville" name="fville" required>
<label><b>Longitude</b></label>
<input type="text" placeholder="Entrer la longitude" name="flong" required>
<label><b>Latitude</b></label>
<input type="text" placeholder="Entrer la latitude" name="flat" required>
<label><b>Description</b></label>
<input type="text" placeholder="Description" name="fdesc" required>
<input type="submit" id='submit' value='Insérer' >
</form>
</div>
</body>
</head>
谢谢您
1条答案
按热度按时间7hiiyaii1#
尝试插入此
在这行之后:
(设置mysqli连接的字符集)