0

Alright so I have got a database that contains data of some different countries such as capital, continent, population. In my language, the continent Asia is translated to Azië. But when I import the data through a query it displays it like this: Azi�

<!DOCTYPE html>
<html>
  <head>
    <title>Opdracht 36</title>
    <meta charset="utf-8" />
  </head>
  <body>
    <table>
      <tr>
        <strong>
          <th>land_id</th>
          <th>land</th>
          <th>hoofdstad</th>
          <th>werelddeel</th>
          <th>inwoners</th>
        </strong>
      </tr>
      <?php 
        $servername = "localhost";
        $username = "root";
        $password = "";
        mysql_connect($servername, $username, $password);
        mysql_select_db("Enigma");
        $query = "SELECT * FROM landen ORDER BY werelddeel";
        $result = mysql_query($query);
        while ($row = mysql_fetch_array($result)) 
        {
      ?>
      <tr>
        <td><?php echo $row["land_id"]; ?></td>
        <td><?php echo $row["land"]; ?></td>
        <td><?php echo $row["hoofdstad"]; ?></td>
        <td><?php echo $row["werelddeel"]; ?></td>
        <td><?php echo $row["inwoners"]; ?></td>
      </tr>
      <?php
        }
      ?>
    </table>
  </body>
</html>
  • oops the code got messed up let me fix it –  Oct 01 '16 at 19:17
  • I just fixed the code if you could refresh the page and help me with what I should change? –  Oct 01 '16 at 19:22
  • Click that link. Your DB connection should be UTF8, your DB should be UTF8, the webpage should be utf8, the page where you wrote the data from should be sending it as utf8. – chris85 Oct 01 '16 at 19:23
  • Read about [_black diamond_](http://stackoverflow.com/a/38363567/1766831) – Rick James Oct 02 '16 at 21:08

0 Answers0