Removing brackets from an array

0

You would need to remove the brackets from an impression of the results of an array within a While. Here is the code:

<?php

$termo = $_GET['termo'];

include "conn.php";
//Consulta busca informações para montar auto-complete 
$sql = "SELECT serie_nome, serie_cod FROM serie WHERE serie_nome LIKE '%$termo%'";
      //$_REQUEST['term']
$res = mysql_query($sql);

while($linha = mysql_fetch_array($res))
{

    $dados[] = array(utf8_encode($linha['serie_nome']));
}

//Envia dados via Json


$dad = json_encode($dados);
echo $dad;

?>
    
asked by anonymous 14.06.2017 / 02:52

1 answer

0

I was able to solve my problem by adding the label in the array to make the autocomplete recognize.     

$dados[] = array('label' => utf8_encode($linha['serie_nome']));
    
14.06.2017 / 03:09