Hi, I want to do a filter per month in which I have field date and field month in the table as I do it? I already divided the date that was in (Y-m-d) to extract the month that month and to convert it into a letter instead of a number but now I want to do the month filter
<td>Mes:<input value="Mes"type="month" name="mes" id="mes"></td>
<td><input type="submit" value="Mostrar" name="mostrar" id="mostrar" >
</td>
</center>
</form>
<br/>
<div class="tbl-header">
<center>
<table class="bordered" cellpadding="0" cellspacing="0" border="0" border="0" class="tab">
<thead>
<tr>
<th scope="col">Solicitud de Servicio</th>
<th scope="col">Folio</th>
<th scope="col">Mes</th>
<th scope="col">Fecha</th>
<th scope="col">Departamento</th>
<th scope="col">Área</th>
<th scope="col">Tipo Servicio</th>
<th scope="col">Descripción del trabajo</th>
<th scope="col">Observaciones</th>
<th scope="col">Unidad</th>
<th scope="col">Costo</th>
</tr>
<?php
if(($_POST['fechaini']=="") && ($_POST['fechafin']==""))
{
$consulta="";
}else
{
$consulta="AND s.fecha BETWEEN '".$_POST['fechaini']."' AND '".$_POST['fechafin']."'";
}
if(isset($_POST["mes"])&& $_POST["mes"]>0)
$consulta.="AND s.fecha=".$_POST['mes'];
$so ="SELECT s.Id_folio, s.fecha,d.id_departamento,g.Id_gerencia,g.Nombre_gerencia, d.nombre,s.descripcion_trabajo, s.observaciones, s.Id_servicio,s.tipo_solicitud, s.costo, s.id_vehiculo, u.Empleado_Nombre, u.Empleado_id, t.Id_servicio, t.Nombre_servicio,s.Autoriza_Soli,s.Autoriza_Ger,s.Autoriza_GerIs,s.Autoriza_trab,s.Autoriza_termi FROM solicitud as s, departamento as d ,gerencias as g,usuarios as u, tipo_servicio as t WHERE s.id_departamento=d.id_departamento and s.Empleado_id =u.Empleado_id and s.Id_servicio =t.Id_servicio and d.id_gerencia=g.Id_gerencia and Autoriza_Soli=1 and Autoriza_Ger =2 and Autoriza_GerIs=3 and Autoriza_trab=4 and Autoriza_termi=5 ".$consulta."";
$mostrarso=mysql_query($so);
while($i=mysql_fetch_array($mostrarso)){
date_default_timezone_set('Europe/Madrid');
setlocale(LC_TIME, 'es_ES.UTF-8');
setlocale(LC_TIME, 'spanish');
$nombremes=strftime("%B", strtotime($fecha_mes=$i[1]));
$fecha_mes=$i[1];
$partes = explode('-', $fecha_mes);
$_fecha = "{$partes[2]}-{$partes[1]}-{$partes[0]} "
?>
<tr>
<td><?php echo $i["tipo_solicitud"];?></td>
<td><?php echo $i["Id_folio"];?></td>
<td><?php echo $nombremes;?></td>
<td><?php echo $i["fecha"];?></td>
<td><?php echo $i["nombre"];?></td>
<td><?php echo $i["Nombre_gerencia"];?></td>
<td><?php echo $i["Nombre_servicio"];?></td>
<td><textarea name="" cols="10" rows="2" autofocus class="form-textarea" id="input_7" title="" data-component="textarea" textarea readonly="readonly"><?php echo $i["descripcion_trabajo"];?></textarea></td>
<td><textarea name="" cols="10" rows="2" autofocus class="form-textarea" id="input_7" title="" data-component="textarea" textarea readonly="readonly"><?php echo $i["observaciones"];?></textarea></td>
<td><?php echo $i["costo"];?></td>
<td><?php echo $i["costo"];?></td>
</tr>
<?php