Вместо кириллицы отображаются вопросительные знаки (не символы)
- Кодировка файла UTF-8 без BOM
- В .htaccess указан utf-8
- MySQL полностью переведена в utf8mb4_general_ci (в самой БД киррилица отображается адекватно)
- Кодировка в < head > указана верно
Сам php:
<?php
$connect = mysqli_connect("localhost", "", "", "");
mysql_query('SET NAMES "utf8"');
$output = '';
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connect, $_POST["query"]);
$query = "
SELECT * FROM post
WHERE title LIKE '%".$search."%'
";
}
else
{
$query = "
SELECT * FROM post ORDER BY test
";
}
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
$output .= '
<div class="table-responsive">
<table class="table table bordered">
<tr>
<th>Customer Name</th>
<th>Address</th>
<th>City</th>
<th>Postal Code</th>
<th>Country</th>
</tr>
';
while($row = mysqli_fetch_array($result))
{
$output .= '
<tr>
<td>'.$row["title"].'</td>
<td>'.$row["test"].'</td>
<td>'.$row["City"].'</td>
<td>'.$row["PostalCode"].'</td>
<td>'.$row["Country"].'</td>
</tr>
';
}
echo $output;
}
else
{
echo 'Data Not Found';
}
?>
Быть может кто сталкивался с подобным? Целый день мучаюсь.