son.of.the.morning Posted December 9, 2011 Share Posted December 9, 2011 Alright guys i have an idea on what am going to do here, although i am unsure that it's the best way to go about it. I am creating a blog and i need to count how many views an article gets in order to display the top 10 most viewed articles. Here is my plan... 1. Add an additional field to my blog posts table called viewed 2. On the view article page have an update method that adds one to the current number on the the coloum viewed 3. When displaying the 10 most viewed articles query it by the heightest number and limet to 5 Quote Link to comment https://forums.phpfreaks.com/topic/252806-page-view-count/ Share on other sites More sharing options...
SergeiSS Posted December 9, 2011 Share Posted December 9, 2011 Idea is good Realize it and enjoy your job. For step 2 it would be nice to create a special function. It would take an id (name etc) of article and add 1 to column viewed. Quote Link to comment https://forums.phpfreaks.com/topic/252806-page-view-count/#findComment-1296110 Share on other sites More sharing options...
son.of.the.morning Posted December 9, 2011 Author Share Posted December 9, 2011 Thanks man i shall get to work then Quote Link to comment https://forums.phpfreaks.com/topic/252806-page-view-count/#findComment-1296113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.