Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

PHP & MySQL (UPDATE statement)

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

vlad230

VIP Member
Impact
15
Hello guys!

I'm currently working on a script that should empty a field in a database every 24h.

PHP:
list($hour, $minute, $second) = explode(":", date("H:i:s", time()));
$empty = "";
if( (intval($hour) == 0) && (intval($minute) == 0) && (intval($second) == 0) ){
	mysql_query("UPDATE `contest` SET 24h_ips='".$empty."' ");
}

The problem is that I thought it will execute even if no one accesses the page (@ 00:00:00), but it seems that I was wrong.... In order to execute someone has to access the page in that precise moment....

Is there some way to make it execute even if no one accesses the page at that time?

Thanks a lot,
Vlad
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What you need is cron job to schedule that task.
 
0
•••
Thanks, I've managed to set one up :)
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back