![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
31/01/2011, 12:33
|
| | Fecha de Ingreso: diciembre-2010
Mensajes: 23
Antigüedad: 14 años, 2 meses Puntos: 1 | |
Filtrar fechas de una bd HOLA, TENGO UN PROBLEMA OJALA ME PUEDAN AYUDAR
DEBO CREAR un boton CUYA funcion DEBE SER borrar todos los USUARIOS CUYA FECHA LIMITE DE PAGO SEA MAYOR A LA FECHA ACTUAL.
LA tabla socios tiene 3 campos: ID USUARIO, NOMBRE Y fecha_limite
hice una funcion para la fecha de hoy :
$fecha_actual = strtotime(date("d-m-Y H:i:00",time()));
entonces, mi consulta es algo asi :
$deleteSQL = sprintf("DELETE FROM socios WHERE fecha_limite>$fecha_actual",
GetSQLValueString($_GET['elim'], "int"));
mysql_select_db($database_cn, $cn);
$Result1 = mysql_query($deleteSQL, $cn) or die(mysql_error());
$deleteGoTo = "bienvenidos.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
pero no me sale. Q estoy haciendo mal??? |