<?
$sql="select * from tb_advban";
$res=mysql_query($sql);
if ($res)
{
while ($row=mysql_fetch_assoc($res))
{
$bd=$row["begindate"];
$d=$row["numdays"];
$t=time();
$d1=($t-$bd)/86400;
if ($d1>$d)
{
$id=$row["id"];
$sql="delete from tb_advban where id='$id'";
mysql_query($sql);
}
}
}
?>