6
I have a query that brings me the first 3 letters of a month name with the last two digits of the year for example: JAN.16 in my combobox it brings me the independent months for example: JAN.16 FEB.16... and so on.
I wanted the combobox or click on JAN.16 take also FEB.16 and MAR.16, in 3 in 3 months or make a block of those 3 months in the combobox that combobox value, I take from 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 that way, it wasn’t replicated the information either:
select mes from tabela where (mes like 'JAN.%' or mes like 'FEV.%' or mes like 'MAR.%');
take those 3 months only that in the combobox appeared only one information someone knows if it has how to do it?
$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 replicates is the option
, but it’s because of while
, what I would like is a option
to take the value of months, this value is in different lines.
Could you post more information? What replicates? What does not work? Where the combobox enters?
– Randrade
Wouldn’t just put the three of us on the option?
<option>Jan Fev Mar</option>
– Bacco