How to query database to delete data at time > 00:00 hours
Collapse
X
-
Guest repliedUse a Cron Job at midnight.
-
I'm quite confused. Are you subtracting how many seconds to 00:00 from current time? It's a toplist that i'm doing and it's necessary i show user how many hits he had per day
Leave a comment:
-
To do this i would take the current time using the PHP time() then take away like so.Originally posted by youngbobby View PostHi guys, i've had problems. What i have in mind achieving is to get the total number of hits i get per day. If there's any other better than the method i want 2 use, i'll love it. Here is what i'm doing: when user visits, i calculate how many seconds from now till 00:00 hours, then add it to current time. Then i query database to delete all data where current time > user's_visit_time.
NB: user's_visit_time = time() + seconds to 00:00 hours. My problem is how to get how many seconds to 00:00 hours. Can someone help me. Thanks
Might have parse error i havnt tested for coding errorsCode:$secondsleft = time() - mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
Leave a comment:
-
Why not just set a counter that counts each visitor as they visit.
Then at 12.00 pmCode:UPDATE database_name SET counter=counter+1
Then if needed store previous counter it beoreCode:UPDATE database_name SET counter='0'
you clear to keep track of how many from the day,week,year before?
Leave a comment:
-
How to query database to delete data at time > 00:00 hours
Hi guys, i've had problems. What i have in mind achieving is to get the total number of hits i get per day. If there's any other better than the method i want 2 use, i'll love it. Here is what i'm doing: when user visits, i calculate how many seconds from now till 00:00 hours, then add it to current time. Then i query database to delete all data where current time > user's_visit_time.
NB: user's_visit_time = time() + seconds to 00:00 hours. My problem is how to get how many seconds to 00:00 hours. Can someone help me. Thanks
Tags: None
Leave a comment: