sheraz Posted November 6, 2010 Share Posted November 6, 2010 hi i am working on a project in which i have to retrieve the articles which are the most visited by the users. i have serched the internet but not find any useful code snippets. can any one guide me how to solve this problem. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/217933-how-to-get-most-viewed-topics/ Share on other sites More sharing options...
Pikachu2000 Posted November 6, 2010 Share Posted November 6, 2010 It would depend on how you store the information regarding how many visits each article has. Quote Link to comment https://forums.phpfreaks.com/topic/217933-how-to-get-most-viewed-topics/#findComment-1131039 Share on other sites More sharing options...
sheraz Posted November 6, 2010 Author Share Posted November 6, 2010 sorry, can you more description which informatio you are talking about. i am storing articles in database. are you talking about a counter for each page and storing the counter value in database Quote Link to comment https://forums.phpfreaks.com/topic/217933-how-to-get-most-viewed-topics/#findComment-1131043 Share on other sites More sharing options...
Anti-Moronic Posted November 6, 2010 Share Posted November 6, 2010 Yeh, there's generally 2 ways this is done. A column within the articles table of the database which increments on each view, or a completely separate table to store data on hits. Unless you require further complex tracking of hits, the first is easiest and will suit your need. If you don't know how to increment a column within a table, I would consider learning a bit more mysql before you attempt any other related tasks. Quote Link to comment https://forums.phpfreaks.com/topic/217933-how-to-get-most-viewed-topics/#findComment-1131048 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.