0

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
3
Views
7 Years
Discussion Span
Last Post by Big-D2xL
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
}
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.

This question has already been answered. 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.