i want to empty a table when the time comes
if time is 12:00am
empty this_Sql
if time is 12:00am
empty this_Sql
$timezone = "8";
$calculate = ($timezone * 60 * 60);
$timenow = date("H", time() + $calculate);
if ($timenow >= "0" && $timenow <= "12" )
{
$acl9 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM bentot_autoclear WHERE l9logs"));
if ($acl9[0] == "1"){
$res = mysql_query("UPDATE ibwf_users SET pid='1' WHERE id='".getuid_sid($sid)."'");
mysql_query("DELETE FROM bentot_autoclear WHERE l9logs");
mysql_query("DELETE FROM ibwf_l9l ");
}
}
if ($timenow >= "13" && $timenow <= "23" )
{
$acl9 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM bentot_autoclear WHERE l9logs"));
if ($acl9[0] == "0"){
mysql_query("INSERT INTO bentot_autoclear SET l9logs='1' ");
}
}
$timezone = "8";
$calculate = ($timezone * 60 * 60);
$timenow = date("H", time() + $calculate);
if ($timenow >= "0" && $timenow <= "14" )
{
$acl9 = mysql_fetch_array(mysql_query("SELECT l9logs FROM bentot_autoclear"));
if ($acl9[0] == "1"){
mysql_query("UPDATE bentot_autoclear SET l9logs='0'");
mysql_query("DELETE FROM ibwf_l9l ");
}
}else{
$acl9 = mysql_fetch_array(mysql_query("SELECT l9logs FROM bentot_autoclear"));
if ($acl9[0] == "0"){
mysql_query("UPDATE bentot_autoclear SET l9logs='1'");
}
}
$timezone = "8";
$calculate = ($timezone * 60 * 60);
$timenow = date("H", time() + $calculate);
if ($timenow >= "0" && $timenow <= "14" )
{
$acl9 = mysql_fetch_array(mysql_query("SELECT l9logs FROM bentot_autoclear"));
if ($acl9[0] == "1"){
mysql_query("UPDATE bentot_autoclear SET l9logs='0'");
mysql_query("DELETE FROM ibwf_l9l ");
}
}else{
$acl9 = mysql_fetch_array(mysql_query("SELECT l9logs FROM bentot_autoclear"));
if ($acl9[0] == "0"){
mysql_query("UPDATE bentot_autoclear SET l9logs='1'");
}
}
Comment