Forum Moderators: coopster

Message Too Old, No Replies

some visitor calculating help

         

CodilX

7:12 pm on Feb 12, 2008 (gmt 0)

10+ Year Member



Hi there :)

I'm having trouble calculating the visits on my site.

Basicly, I want to get an output, displaying on the left the months, on the other the numbers of visits, example:

January - 800
February - 900
March - 1000
... etc

I have no idea how to the script to show all the months I have on my db, and calculate those visits.

Also, another thing I'd like to see, is when I click on that month, that it will show all dates of that month on the left, and visits on the right.. again .. no idea how to get that information ..

Hope someone will give me a hand, thanks

eelixduppy

2:55 am on Feb 13, 2008 (gmt 0)



>>I have no idea how to the script to show all the months I have on my db, and calculate those visits.

What is the structure of your database table(s)? Maybe you want to take a look at the following thread on extracting data from MySQL: [webmasterworld.com...]

CodilX

9:03 am on Feb 13, 2008 (gmt 0)

10+ Year Member



I know how to extract, but I don't know how to get a list of months available in my database, how to specify those months while extracting data, and also certain days ..

the database is simple: id, date (yyyy-mm-dd), ip, referrer

jatar_k

4:20 pm on Feb 13, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



take a look at

MySQL Date and Time Functions [dev.mysql.com]
GROUP BY [dev.mysql.com]
COUNT [dev.mysql.com]

I might also look at having individual columns for year, month and day. That might allow for more complex grouping and sorting. Though I wouldn't jump into any db changes before you see if they are actually needed.