We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,344 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Statistic Zone

Hi, I know this forum for a while and it has been helping me for a time, now I registered myself and I have a question to make you:

I'm making a zone in my website where I can see a Top10 of links, products and news, and all of the info is saved in a MySql db the question/problem is that I want to see how many times a determined thing was seen per hour.


e.g. between 1am and 2 am link1 was visited 11 times.

Any sugestions?

Thanks, in advance.

2
Contributors
2
Replies
2 Hours
Discussion Span
3 Years Ago
Last Updated
3
Views
Question
Answered
Big-D2xL
Newbie Poster
4 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You could make an additional table in your database where you store a linkname and a counter? Each time someone clicks a link, you update the table.

example:

table (link_visits) =

link(varchar)           |  visits (integer)
-------------------------------------------------
contact                 |   1
other_page              |   12
function UpdateCounter($link_name) {
     $query = "update link_visits set visits = 
                      ((select visits from link_visits where link = '".$link_name."') + 1)";
    //etc
}
n_e
Junior Poster in Training
97 posts since Feb 2010
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 0

I was actually thinking about doing that, when you told me that, I did it and for now it´s working like a charm. I implemented some other stuff I wanted and its rollin'. Thanks for the sugestion.

Big-D2xL
Newbie Poster
4 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 3 Years Ago by n_e

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0640 seconds using 2.71MB