Michdd Posted July 2, 2009 Share Posted July 2, 2009 I need help creating a query to get the most popular topics. I was thinking that I could get the average time/post by getting the time since a topic was posted (timeNow - TimePosted) divided by the amount of posts it has then order by that ASC. But I don't think it's possible to formulate a sql statement like that because you'd have to loop through all the topics to get the amount of posts in the topic. Any ideas on how I can get which are the most popular? Link to comment https://forums.phpfreaks.com/topic/164572-most-popular-topics/ Share on other sites More sharing options...
iPixel Posted July 2, 2009 Share Posted July 2, 2009 Have a post counter? then select all topics and Order by that counter in DESC order? So each post will add +1 to that posts coutner and so on... Link to comment https://forums.phpfreaks.com/topic/164572-most-popular-topics/#findComment-868013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.