I have a query that brings me the first 3 letters of the name of a month with the last two digits of the year for example: JAN.16 in my combobox it brings me months independent for example: JAN.16 FEV.16 ... and on and on.
I wanted the combobox or click on JAN.16 also get FEV.16 and MAR.16, in 3 in 3 months or make a block of those 3 months in the combobox that value of the combobox, I get the database with the query below
select mes from tabela where mes in ('JAN.16');
select mes from tabela where mes in ('FEV.16');... e por ai vai chegar DEZ.16.
I tried this way, also the information was not replicated:
select mes from tabela where (mes like 'JAN.%' or mes like 'FEV.%' or mes like 'MAR.%');
$q1 = mysql_query("select distinct mes from reparo.falhas_consolidadas where mes like 'JAN%' or mes like 'FEV%' or mes like 'MAR%'");
<td><select multiple name="month[]" id="month">
<option value="">Selecione</option>
<?php
while($m1 = mysql_fetch_array($q1)){
echo "<option value='$m1[0]'>Q1</option>";
}
?>
</select>
What it replicates is option
, but it is because of while
, what I would like is option
to get the value of months, this value is in different rows.