Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/06/2005, 09:22
gonz_mp
 
Fecha de Ingreso: mayo-2005
Mensajes: 53
Antigüedad: 18 años, 11 meses
Puntos: 0
Pregunta Eliminar registro en 7 dias

Hola amigos

Una vez mas los molesto con otra duda

Quiero saber como eliminar un registro automaticamente cuando pasen 7 dias:

Aqui les dejo el codigo :

Código PHP:
<html>
<head><title>Anuncios .::Coatepec::.</title></head>
<body>
<SCRIPT LANGUAGE="jAVASCRIPT">
function nuevo_anuncio(){
window.open("anuncios/insertar.php","nuevo","toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=400 height=350")
}  
</SCRIPT>
<h1 align=center><i>ANUNCIOS</i></h1>
<h2 align=center><a href="javascript:nuevo_anuncio();">Click aqui para agregar nuevo anuncio</a></h2>
<?
$link 
mysql_connect("localhost","usuario","contraseña");
mysql_select_db("db",$link);
$result mysql_query("SELECT Nombre,Email,Texto,ID,Lugar,fecha FROM anuncios ORDER BY fecha DESC"$link);
echo 
"<table border = '1' bordercolor='black' width='90%' align='center' bgcolor='#555555'>";
while (
$row mysql_fetch_row($result)){
echo 
"<tr> \n";
echo 
"<td align='center' bgcolor='#68abd6' width='45%'><p align='center'>$row[2]</p></td> \n";
echo 
"<td width='45%'><b> \n";
echo 
date('d-m',$row[5]);
echo 
"</b><br> \n";
echo 
"<font color='#c9c9c9'><b>Nombre:&nbsp;</b></font>$row[0]<br> \n";
echo 
"<font color='#c9c9c9'><b>Lugar:&nbsp;</b></font>$row[4]<br> \n";
echo 
"<font color='#c9c9c9'><b>E-Mail:&nbsp;</b></font>$row[1]<br></td> \n";
echo 
"</tr> \n";
}
echo 
"</table> \n";
?>
</body>
</html>
gracias a todos.