time to empty sql
Started on the old forum in November 2009 · view the original in the archive · old links redirect here
kei_ki7 wrote: i want to empty a table when the time comes 🙂
if time is 12:00am empty this_Sql
wouldnt that be safer to do it manualy?🤨
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!
$timezone = "0"; $calculate = ($timezone * 60 * 60); $timenow = date("h", time() + $calculate);
if ($timenow == "12) { mysql_query("DELETE FROM tablename_here "); }
this should help you, bro.
mysterio.al - programming is a functional art
Mysterio3 wrote: $timezone = "0"; $calculate = ($timezone * 60 * 60); $timenow = date("h", time() + $calculate);
if ($timenow == "12) { mysql_query("DELETE FROM tablename_here "); }
this should help you, bro.
thanks bro, but this code cant do automatically, its like a manual deleting a sql by loading the page where the code,
blackhowk wrote: cron job the file
im sory mate, i cant get what you've said
$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' ");
}
}
i make this and its work, but its only a remedy because i dont know how to code in nice way
$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'");
}
}
i recode like this, what do you think?
$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'"); } }i recode like this, what do you think?
but that does not delete in hour 00., but from time 0 to 14, it delete every time you execute it. and still is not automatic.
mysterio.al - programming is a functional art
