cordoprod Posted May 24, 2008 Share Posted May 24, 2008 Hello =) I develope a community system and when an user visits another user it adds one more.. The DB structure is like this: nick | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | total I want all the weekdays to be reset to 0 one day a week.. (not the total col) Do you know how to do that? Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/ Share on other sites More sharing options...
cordoprod Posted May 24, 2008 Author Share Posted May 24, 2008 Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/#findComment-548915 Share on other sites More sharing options...
BlueSkyIS Posted May 24, 2008 Share Posted May 24, 2008 UPDATE some_table SET Monday = 0, Tuesday = 0, Wednesday = 0, Thursday = 0, Friday = 0, Saturday = 0, Sunday = 0 WHERE nick = 'some_value' Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/#findComment-548918 Share on other sites More sharing options...
cordoprod Posted May 24, 2008 Author Share Posted May 24, 2008 Yeah, i know that.. But i want to do that e.g one time on monday..Understand? Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/#findComment-548937 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 Make a script to update your table, in it's own file. Setup a cron job to run it every x time/day that you want it. If you do not have the server access to start a cron job, you're going to have to basically make a script that's called on every page load to check the date/time and run it if it's the appropriate date/time. This isn't as accurate though, as it is dependent on pages being requested by people. Also it uses more resources and generally slows down everything. Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/#findComment-548940 Share on other sites More sharing options...
Barand Posted May 24, 2008 Share Posted May 24, 2008 Do you do anything with those daily totals before they are cleared? Quote Link to comment https://forums.phpfreaks.com/topic/107077-solved-statistics-help/#findComment-549063 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.