alfieshooter1 Posted November 28, 2008 Share Posted November 28, 2008 I reckon this should be so easy, but I'm going round in circles fast. I have a table called fans: id, username, fanof, dateadded I want to return the most popular for a particular date, so I need to somehow select the 'fanof's added on that date and then sort them in order of how many 'fanof's there are. I.e 1, Bob, Sally, today 2, Bob, Jim, today 3, Bob, Bill, today 4, Bob, Sally, today 5, Bob, Bill, today 6, Bob, Bill, today Would return: Bill (most popular) Sally Jim Does that make ANY sense? Please help. Link to comment https://forums.phpfreaks.com/topic/134654-solved-got-myself-in-a-tizz-trying-to-work-out-the-most-popular/ Share on other sites More sharing options...
fenway Posted November 28, 2008 Share Posted November 28, 2008 You mean like select username, count(*) from fans where dateadded = <the-date-you-want> group by username ? Link to comment https://forums.phpfreaks.com/topic/134654-solved-got-myself-in-a-tizz-trying-to-work-out-the-most-popular/#findComment-701264 Share on other sites More sharing options...
alfieshooter1 Posted November 28, 2008 Author Share Posted November 28, 2008 I BLOODY DO!!! Thanks so much! Alfie. Link to comment https://forums.phpfreaks.com/topic/134654-solved-got-myself-in-a-tizz-trying-to-work-out-the-most-popular/#findComment-701281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.