5 Replies Latest reply: Feb 5, 2013 1:28 PM by bregent RSS

    PHP/MySQL Page counter

    matthew stuart Community Member

      I know, it's an often asked question, but I think I have a different requirement to most samples that I have found out there on the net, so I thought I'd ask for some advice here.

       

      I am looking to create a page counter that is stored within the MySQL database as part of the record that has been viewed. and I am not quite sure as to how to go about this.

       

      I know I need a column in my table that stores the amount of times a record has been viewed, but I can't figure out how I should firstly trigger how a record has been viewed, and then I can't figure out how to increment it by one each time it has been viewed.

       

      I don't really want to have a separate table for the counter as I intend to use the info elsewhere where it is pulling the whole record info onto a page.

       

      Any thoughts/tuts/examples/samples are welcome.

       

      Many thanks.