0
I cannot remove duplicate records in the array
$query = $pdo->prepare("SELECT * FROM produtos order by Data asc");
$query -> execute();
$ContCampos = $query -> rowCount();
$consulArray = array();
while($consulta = $query ->fetch(PDO::FETCH_ASSOC)){
$consulArray[] = array_unique($consulta);
}
foreach($consulArray as $copia1)
{
$nome = $copia1['Nome'];
echo '<option>'.$nome.'</option>';
}
print_r($nome);
I searched the comic book, and I need you to return the date and the name, but not return duplicate data! has the option to use the select distincs but did not want to use it! I don’t know why the array_unique is not filtering, if someone can help me!
Select result
Array ( [0] => Array ( [id] => 83 [Nome] => Ana Carla Pagung [Verdura] => QUIABO [Quantidade] => 2 [Observacao] => [Unidade] => KILOS [Data] => 2018-05-07 )
[1] => Array ( [id] => 84 [Nome] => Ana Carla Pagung [Verdura] => QUIABO [Quantidade] => 25 [Observacao] => [Unidade] => CAIXAS [Data] => 2018-04-05 )
within the array have any values that are unique to the record? type an ID? You will only use the same name in the example?
– Wees Smith
I put the print_r result, I need in case the Date and Name that is in the array
– Marcos Marciel Pagung
So in this case it has no iguas values, they are different requisitions, but of the same person
– Wees Smith
You want to do exactly what? display what?
– Wees Smith