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 🙂
How to query database to delete data at time > 00:00 hours
Started on the old forum in December 2009 · view the original in the archive · old links redirect here
youngbobby wrote: 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 :)
To do this i would take the current time using the PHP time() then take away like so.
$secondsleft = time() - mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
Might have parse error i havnt tested for coding errors
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