time to empty sql

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

9 replies · 374 views · started 17 years ago · 1 min read

4 participants
kei_ki7 Senior · 431 posts #1

i want to empty a table when the time comes 🙂

if time is 12:00am empty this_Sql

Did I help you? You can help me too Your donations will help me finance my studies.

metulj Super moderator Principal · 1,726 posts #2

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ノ刀ノイリ!

kei_ki7 Senior · 431 posts #3

why? is there negative there?

i dont know if there is.

i just want to empty a table 🙂

Did I help you? You can help me too Your donations will help me finance my studies.

Mysterio Lead · 630 posts #4

$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

kei_ki7 Senior · 431 posts #5

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,

Did I help you? You can help me too Your donations will help me finance my studies.

kei_ki7 Senior · 431 posts #7

blackhowk wrote: cron job the file

im sory mate, i cant get what you've said

Did I help you? You can help me too Your donations will help me finance my studies.

kei_ki7 Senior · 431 posts #8
$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

Did I help you? You can help me too Your donations will help me finance my studies.

kei_ki7 Senior · 431 posts #9
$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?

Did I help you? You can help me too Your donations will help me finance my studies.

Mysterio Lead · 630 posts #10

kei_ki7 wrote:

$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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close