KevHopwood Posted September 10, 2013 Share Posted September 10, 2013 Hi all. I have a mobile cms website situated <a href="http://www.xclo.mobi/xclo2">here</a> all of my apps and offers are located in a database. Is there a way for me to add a popular / most visited section to my site that reads how many times each offer has been viewed and for it to display a lost of the top 5. Can some one help me on how to do this? Thanks. Link to comment https://forums.phpfreaks.com/topic/282039-top-5-most-viewed/ Share on other sites More sharing options...
fastsol Posted September 10, 2013 Share Posted September 10, 2013 Here's a tutorial on how to setup the page hit counter. http://www.youtube.com/playlist?list=PLD527AE17B0A9F1F1 Then you can do some simple queries to get the top 5 highest views. Link to comment https://forums.phpfreaks.com/topic/282039-top-5-most-viewed/#findComment-1448974 Share on other sites More sharing options...
cataiin Posted September 10, 2013 Share Posted September 10, 2013 count views: mysql_query("UPDATE apps SET views=views+1 WHERE id='".$id."'"); show 5 most viewed: mysql_query("SELECT * FROM apps ORDER BY views DESC LIMIT 0, 5"); Don't forget to add column "views". My code is just an example. Link to comment https://forums.phpfreaks.com/topic/282039-top-5-most-viewed/#findComment-1448979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.