0

Hi all,

I'm an aspiring PHP developer doing some side jobs just for fun and I was wondering if someone can help me out with this.

I'm working on a project now which stores $_POST information into a separate table called 'stats'. I'm trying to create an 'admin backend' for my user so they can see how many people had used their service, as well as some calculated figures which I've managed to store into the database.

Now what I'm wondering is, how would I go about separating all of this data by the day so they can do a comparison by the days, weeks, months, years etc.

For example, if they wanted to see how many users used their service on August 12, 2010, how would I create 'filters' so they can see that date as well as if they were looking for, how many users thought the service was helpful in the month of August?

Would I need to create a timestamp as a field? What type?

Thanks for your advice and assistance in advance experts!

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by urtrivedi
0

Best way is to save information linkwise and datewise

linkname varchar(255) //
trans_date date
total integer

when ever some link is opened insert/update above table. if date,link combination does not exist then insert it else update total=total+1

now for reporting periodwise is very easy say if you want monthwise

select  date_format(trans_date,'%b-%Y') month , sum(total) total from table group by date_format(trans_date,'%b-%Y') where date_format(trans_date,'%b-%Y')='AUG-2009' and linkname='www.mysite.com/myfolder/mypage.php'

you can find out various required option by looking into date_format() manaul.

Edited by urtrivedi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.