Good afternoon, I'm getting an error that I've never seen, trying to use the jquery autocomplete, follows the image, and the encoding:
PHP:(Iusedasanexample,Ididnotaddthelikeinselect,theyaredynamicvalues!)
<?phprequire_once('acessabanco.php');$objDb=newdb();$link=$objDb->conecta_banco();$sql="SELECT p.sequencia codigo,
p.nome_completo nome,
c.data_nascimento data,
t.celular_1 celular
FROM pessoas p,
clientes c,
telefones t
WHERE p.sequencia = t.cod_pessoa
AND c.cod_pessoa = p.sequencia";
$exec = mysqli_query($link, $sql);
if ($exec){
while ($clientes = mysqli_fetch_array($exec)){
$vetor[] = array('Sequencia' => $clientes['codigo'], 'Nome' => $clientes['nome']);
}
echo json_encode($vetor);
}
JQUERY:
$.getJSON("php/lista_clientes.php", function(data){
var teste = [];
$(data).each(function(key, value){
teste.push(value.Nome);
});
});
$( "#buscar_cliente" ).autocomplete({
source: teste
});
If someone knows what it's about, I'll be very grateful if you can help!