I was looking forward to add a feature to my project which can tell us how many times the post has been viewed, but just can't get how is it done. I am not a programming expert but still have good knowledge of php, mysql so if anybody can just give me idea how it is done. Currently I display all posts on main page and on clicking title of post user gets redirected to post page were full post is displayed so surely something is to be done on post page but what I have to count their?
Jump to Post
The way you want it (without counting only special views e.g. from members) is quite easy. Add a “viewed” int counter with default 0 , in your table and each time the app displays the full post update it incrementing it by one e.g. (SET viewed = viewed + 1)
All 3 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.