I need urgent help, I'm doing a query in the database in several different array. When information "implode" and get caught again with "explode", however, I get repeated values and I wanted the same function as "SELECT DISTINCT". Does anyone know how to solve it? Code:
<h4>Cores</h4>
<?php
while($row_mestre = mysqli_fetch_assoc($matrizMestre))
{
$CorNormal = $row_mestre["CorProduto"];
if(strpos($CorNormal,",") == FALSE)
{
$CorFinal = $CorNormal;
echo '<input type="checkbox" name="CorConsulta[]" value="$CorFinal[$j]"/>'. $CorFinal.'<br/>';
}
else
{
$CorFinal = explode(",",$CorNormal);
if (is_array($CorFinal))
{
for($j=0;$j<sizeof($CorFinal);$j++)
{
echo '<input type="checkbox" name="CorConsulta[]" value="$CorFinal[$j]"/>'. $CorFinal[$j].'<br/>';
}
}
}
}
?>
</div>
Table images and how it is shown link