0

When I try to fetch and display some data from a database, the specials characters like 'é' don't appear properly.

Watch it : 'problème' word with an issue of display

I have set the table as it is shown here : table settings

And, here is the code I use to fetch 'problème' :

    <?php

    $dbServername = "XXX";
    $dbUsername = "XXX";
    $dbPassword = "XXX";
    $dbDatabase = "XXX";

    //connexion
    $mysqli = new mysqli($dbServername, $dbUsername, $dbPassword, $dbDatabase);


    //select the right table
    $resultUser = mysqli_query($mysqli, "SELECT * FROM user");



    $i = 0;
    $dbTableUsers = [];


    //making a table to save the data in
    while($ru = mysqli_fetch_array($resultUser)){
        $dbTableUsers[0][$i] = $ru['firstName'];
        $i++;
    }

    //display the first firstname
    echo $dbTableUsers[0][0];

    
    //déconnexion
    mysqli_close($mysqli);
?>

0 Answers0