Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/06/2007, 11:36
Avatar de Yranac
Yranac
 
Fecha de Ingreso: junio-2007
Mensajes: 125
Antigüedad: 16 años, 11 meses
Puntos: 1
Re: Consulta mysql por fecha

1.-
Código PHP:
$sql 'select campo1, campo2 from tabla where fecha < "' $_GET['anio'] . '-' $_GET['mes'] . '-' $_GET['dia'] . '"'
2.-
Código PHP:
$sql 'select campo1, campo2 from tabla where fecha like "%-' $_GET['dia'] . '"'
3.-
Código PHP:
$sql 'select campo1, campo2 from tabla where fecha like "' $_GET['anio'] . '-%"'
Espero te sirvan, no he tenido tiempo de probarlas, las hice sobra la marcha