0
I have a table that when I include some text that contains accent add all other texts of the same condition. tried several ways to use UTF-8 I found on the net but none worked and I noticed in the console.log() the following error only if you have any table item with accent: "Uncaught Syntaxerror: Unexpected end of input" And if I list something else from the table (where it contains no word with accent ) I have return normally.
ret_data.php
<?php
if ( isset($_POST['date']) ) {
$date = $_POST['date'];
}
$id_dentista = $_POST['id_dentista'];
$conecta = mysqli_connect("localhost","root","","odonto");
mysql_query("SET NAMES 'utf8';");
$selecao = "SELECT * from agenda WHERE dataAgenda = '{$date}' AND dentistaId = '{$id_dentista}' ORDER BY horaAgenda ";
$categorias = mysqli_query($conecta,$selecao);
$retorno = array();
while($linha = mysqli_fetch_object($categorias)) {
$retorno[] = $linha;
};
echo json_encode($retorno);
// fechar conecta
mysqli_close($conecta);
?>
very good guy.. I tried thousands of ways to set the utf8 and that was the only solution!! thank you very much
– Fernando Fefu