I have this code that brings me the months registered in the bank. More like it has several lines, I want to return only once each value.
// Fazendo a conexão
$conexao = mysqli_connect($this->dbservidor,$this->dbusuario,$this->dbsenha) or die (mysqli_connect_error($conexao));
$select = mysqli_select_db($conexao,$this->dbnome) or die (mysqli_connect_error($select));
$query = mysqli_query($conexao, " SELECT mes FROM programacaoclientes WHERE idCliente = '$idCliente' ");
$array = mysqli_fetch_array($query);
$nums = mysqli_num_rows($query);
//
if ( $nums > 0 )
{
// percorrendo
do
{
// pegando as datas
$mes = $array['mes'];
//
echo "<p> <a href='a.php'>$mes</a> </p>";
}while( $array = mysqli_fetch_array($query) );
}
Sáida:
Julho
Julho
Julho
Agosto
Agosto
I wanted to return only once, without repeating ... What methodology should I use?