in reply to Re: DB Ovewriting (again..)/ Counter Question
in thread DB Ovewriting (again..)/ Counter Question

Ok, you figured out what the error was. I am so frustrated because it was a simple thing like 'the database isn't being made'. I was nearly sure it was (though I should have checked) because my or die(warn..) never mentioned anything.

As for the counter script would I have to do something which will calculate hours into days into a week so the script can work with it?

Thanks for your help!

"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

  • Comment on Re: Re: DB Ovewriting (again..)/ Counter Question

Replies are listed 'Best First'.
Re: Re: Re: DB Ovewriting (again..)/ Counter Question
by jasonk (Parson) on Apr 06, 2003 at 06:58 UTC
    As for the counter script would I have to do something which will calculate hours into days into a week so the script can work with it?

    I would just store it along with the current date, if storing it in a dbm, you could just do $counters{$date}++;. That way you get a dbm with dates for keys, and counts for value. To get a count for the week, just figure out which 7 days make up the week you want data for (using Date::Calc or something similar would make it easy), then add up the counters for those 7 days. To get a total count, add up all the values.


    We're not surrounded, we're in a target-rich environment!