Hello!
For some reason when I output data some characters are not shown properly. I have tried everything I know but I just can’t get it work. Other outputs in my site are working fine.
Here is the code:
<?php
$connect = mysqli_connect("localhost", "root", "", "tartalomkezelo");
$output = '';
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connect, $_POST["query"]);
$query = "SELECT * FROM products WHERE title LIKE '%$search%' AND deleted = 0 LIMIT 10";
}
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
$output .= '
<div class="index-instant-search-background">
<table class="table table-striped">
<tr>
<th>Termék</th>
<th>Kiszerelés</th>
</tr>
';
while($row = mysqli_fetch_array($result))
{
$output .= '
<tr>
<td><a class="index-instant-search-link" href="products.php?id='.$row["id"].'">'.$row["title"].'</td>
<td>'.$row["weight"].' '.$row["weight_opt"].'</a></td>
</tr>
';
}
echo $output;
}
else
{
echo 'Nincs találat!';
}
?>
</table>
</div>