in reply to DB Ovewriting (again..)/ Counter Question
Your first script works fine, if you were checking the result of the tie, you would probably find that there is some sort of error opening the dbm file (probably permissions, since it's a CGI script, the user the cgi runs as probably doesn't have permission to write to the directory you are asking it to create the database in).
For the second part, I would store a count of the hits for each day associated with their dates, that way you actually only store one count for each day, so when you want your script to display $hitstoday, you just display the counter for that day, when you want $weekhits, you add up the last 7 days of hits in your database and display that, and if you want $totalhits, you add up the counters for all the dates.
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DB Ovewriting (again..)/ Counter Question
by sulfericacid (Deacon) on Apr 06, 2003 at 06:37 UTC | |
by jasonk (Parson) on Apr 06, 2003 at 06:58 UTC |