who can help me with this I need you to filter the records for months by selecting a combobox value

0
<form name="lmes" method='post' action='reporta.php' >
&nbsp&nbsp&nbsp&nbsp<label for="client">seleccionar por meses&nbsp&nbsp</label>&nbsp&nbsp
     <SELECT  name="listam" onchange="this.form.submit();" > 


<OPTION VALUE="1"<?php if($_POST['listam']=='1')echo $mesmenos; ?>>   1     MES </OPTION>
<OPTION VALUE="2" <?php if($_POST['listam']=='2')echo $mesmenos2 ;?> >   2 MESES </OPTION>
<OPTION VALUE="3"<?php if($_POST['listam']=='3')echo $mesmenos3 ;?> >   3 MESES </OPTION>
<OPTION VALUE="4"<?php if($_POST['listam']=='4')echo $mesmenos4 ;?>>   4 MESES </OPTION>
<OPTION VALUE="5"<?php if($_POST['listam']=='5')echo $mesmenos5 ;?>>   5 MESES </OPTION>
<OPTION VALUE="6"<?php if($_POST['listam']=='6')echo $mesmenos6 ;?>>   6 MESES </OPTION>
<OPTION VALUE="7"<?php if($_POST['listam']=='7')echo $mesmenos7 ;?>>   7 MESES </OPTION>
<OPTION VALUE="8"<?php if($_POST['listam']=='8')echo $mesmenos8 ;?>>   8 MESES </OPTION>
<OPTION VALUE="9"<?php if($_POST['listam']=='9')echo $mesmenos9 ;?>>   9 MESES </OPTION>
<OPTION VALUE="10"<?php if($_POST['listam']=='10')echo $mesmenos10 ;?>>  10 MESES  </OPTION>
<OPTION VALUE="11"<?php if($_POST['listam']=='11')echo $mesmenos11 ;?>>  11 MESES </OPTION>
 <OPTION VALUE="12"<?php if($_POST['listam']=='12')echo $mesmenos12 ;?>>  12 MESES </OPTION>
<?php


//y esta es mi consulta donde debo se debe filtrar el registro segun lo elija


    $consulta="select pedido.idpedido,cliente.empresa,cliente.nomcliente,pedido.fecha,pedido.subtotal,pedido.igv,pedido.total,pedido.estado,pedido.descto,pedido.fechap,pedido.detrac from pedido,cliente where (cliente.idcliente=pedido.idcliente) and (cliente.empresa like '%$filtercli%') and (fecha between **'$mesmenos'** and curdate())"; 
    
asked by Miguel Rissca Leon Apaclla 28.02.2018 в 16:50
source

0 answers