Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/07/2006, 09:35
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 5 meses
Puntos: 11
En tus tablas crea un campo fecha, luego cuando hagas el select puedes hacerlo asi:

select * from tabla where datediff(now(),fecha)<=5;

Nota 1:

datediff() requiere mysql 5.

Otra opcion para versiones anteriores, es:

select * from tabla where (unix_timestamp(now())-unix_timestamp(fecha))<=432000;

Nota 1:

432000 = 60 segundos * 60 minutos * 24 horas * 5 dias
Especifica 5 dias en segundos.