I am trying to parse hits per hour from a database. Data is mainly stored as follows:
Table Name: Visitors
VisitorIP TIMESTAMP
15.215.65.65 123456789
I want to show the total number of views per hour (within the last 6 hours), including hours in which there are no hits. Output Example:
// Assuming now : 21:00
21:00 - 0 hits
20:00 - 1 hits
19:00 - 4 hits
18:00 - 0 hits
17:00 - 2 hits
16:00 - 3 hits
I would like to receive the data as an array. Note that the saved date is in UNIX timestamp format. and maybe a few hours without any hits!
thank
source
share