dachshund Posted July 2, 2009 Share Posted July 2, 2009 hi, at the moment I have this code $sql = "UPDATE features SET views=views+1 WHERE id='$id'"; mysql_query($sql) or die (mysql_error()); to add 1 to the views each time someone goes on the page. I use this to have a 'most viewed' side panel, but obviously this is just the most viewed of all time. is there any way to change this so that it's most viewed this week/past 7 days? any help would be very useful. thanks Link to comment https://forums.phpfreaks.com/topic/164484-most-viewed-this-week-not-most-viewed-of-all-time/ Share on other sites More sharing options...
Mark Baker Posted July 2, 2009 Share Posted July 2, 2009 Not without recording when the feature was viewed or resetting your view count to 0 at the beginning of the week Link to comment https://forums.phpfreaks.com/topic/164484-most-viewed-this-week-not-most-viewed-of-all-time/#findComment-867669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.