-2
You would need to remove the brackets from a print of the results of an array within a While. Follow 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;
?>
What would be "remove the clasps from a print"?
– Woss
Must-read: Why should we not use mysql type functions_*?
– Woss
Well, I opened this topic because the print of the result brought "[[resultado1], [resultado2]]". But now I solved my problem which was to add the 'label' in the array that the autocomplete recognized the search. Thank you very much for the tip not to use the mysql function but I am developing it for testing and then I will migrate to mysqli and Pdo.
– Mateus José Pretti