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

Started on the old forum in November 2014 · view the original in the archive · old links redirect here

4 replies · 97 views · started 12 years ago · 1 min read

4 participants
chor Junior · 14 posts #1

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

chor Junior · 14 posts #3

any other code ? bro tell me

GumSlone Administrator Principal · 1,690 posts #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:

mysql_query("UPDATE `album` SET `hits` = 0 WHERE id > 0");

this will reset the hits value for all albums to zero

👍 1
Share

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

kevk3v Senior · 332 posts #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

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close