So I manually inserted data in my database using PHPMyAdmin on a wamp server. My database is in utf8_bin, my table is in utf8_bin and the column of the table is in utf8_bin. I added the menu name "Hébergement" (meaning hosting in french). While in PHPMyAdmin, the accents show as expected and the Data is readable with the accents.
When I load the menu name, instead of the accent I will get this: H�bergement.
Here's a resume of the PHP
$connection = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
$query = "SELECT * ";
$query .= "FROM category ";
$query .= "WHERE id = {$newSection}";
$sectionInfo = mysqli_query($connection, $query);
$section = mysqli_fetch_assoc($sectionInfo);
$output .= $section["name"];
echo $output;
If I replace the $output
with $output = "Héberment";
the echo will display the accent so the problem is not from my HTML or my PHP.
Now if I UPDATE
the field with the word written in plain text in a PHP page and then query its new content, it will display the accent. The problem is that now the "é" is replaced with "é" inside of PHPMyAdmin rendering my text unreadable.
Now since PHPMyAdmin is a web page, and it was able to display to me the accents correctly, there must be a way to query the tables content in the same way as PHPMyAdmin and have it show as accent, not "�" while keeping the content readable within PHPMyAdmin.
I am a beginner in the PHP and MySQL so let me know if you need more details.
Edit: To clarify, I took a screenshot of a line I partially editted in PHPMyAdmin (added the readable accent manualy) to illustrate the opposition of readability.