Mysqli does not return results [duplicate]

0

Colleagues.

I'm trying to get results from a mysql table, but it's not working. What is causing me strangeness is that when the information has accents, it does not work, and in the database the accents are correct. See:

include("includes/conexao.php"); // Faço a conexão

$escola = htmlentities(filter_input(INPUT_POST,"BuscarEscola"));
$escolaSeguro = mysqli_real_escape_string($con,$escola);

$sqlEscolas = mysqli_query($con,"SELECT * FROM escolas WHERE nome = 'Colégio Inclusão';");
$jmEscolas = mysqli_fetch_object($sqlEscolas);
echo "Nome " .$jmEscolas->nome;
    
asked by anonymous 16.11.2016 / 20:51

1 answer

-1

Set UTF8 in your project.

In the HTML header of your documents you can do this. See:

<meta charset="utf-8" />

However, it is not 100% of the time that the server accepts this HTML and continues to "unconfigure" special characters.

In such cases, instead of defining the encoding by the HTML header, define it using the ini_set function of the php itself.

<?php
ini_set('default_charset','UTF-8');
?>
    
16.11.2016 / 21:30