In message <Q_*******************@wards.force9.net>, Dariusz
<ng@lycaus.plusYOURSHIT.com> writes
I have written a database that counts the number of times a file has
been accessed, so I can then later display the results on what is "hot" and
what is not. At the moment all it does is count the total hits, it does
not log per-month the results, which is what I'd like to try.
So suppose I have a database that on initial creation (in month May) looks
like:
ID URL Accessed
1 whatever1 1
2 whatever2 4
3 whatever3 17
However, in June I decide to add to the database another file to download
in the database, so for June now it becomes:
ID URL Accessed
1 whatever1 4
2 whatever2 3
3 whatever3 9
4 whatever4 21
But now when I want to display the results for May and June, how do I
display Mays results (marked with "x" below) as there is no ID4 field as
there was no such file to download in that month?
ID URL May June
1 whatever1 1 4
2 whatever2 4 3
3 whatever3 17 9
4 whatever4 x 21
What I'm getting at, is that every time I add a file to the table, it will
alter the table structure, so what to do with the previous months where
there will not be that file data.
Dariusz
Try a different count table structure. If you add a column to hold the
month (or month & year) to the table, then you won't have to keep
changing the structure of the table. You can simply either update the
existing row, or insert a new one for the first count for a given month
or month & year.
--
Five Cats
Email to: cats_spam at uk2 dot net