How to Count Hits by week after automatic zero 0 Pls Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Count Hits by week after automatic zero 0 Pls Help

    $files=mysql_fetch_array($sqlz);
    mysql_query("UPDATE `album` SET `hits` = hits + 1 WHERE id = $file[id]");

    #2

    Comment


      #3
      any other code ? bro tell me

      Comment


        #4
        its not enough to do it with the code you posted above, there are several ways to do so,
        as i can see you don't have much experience with coding, so the easiest way to reset counters weekly you can create a cronjob which will set all counters to zero.

        run a cron job once a week with this code:
        PHP Code:
        mysql_query("UPDATE `album` SET `hits` = 0 WHERE id > 0"); 
        this will reset the hits value for all albums to zero
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          GumSlone gave a good solution.

          Hey Gumslone can you please add the chat back to the main page?
          Sorry for all the things I said btw, truth is I can never leave this site because it's where I started >.<
          Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

          Comment

          Working...
          X