iNod Eating PieVIP Member VIP โ 20 โ Impact 66 Aug 25, 2005 601 views 6 replies #1 Hello, I have this section I want to display the top 5 viewed tutorials.. So I want to list 5 tutorials with the highest number for field hits.. My currently php code PHP: $gethottuts = mysql_query("SELECT * from tutorials ORDER BY hits ASC LIMIT 5"); Any ideas? iNod
Hello, I have this section I want to display the top 5 viewed tutorials.. So I want to list 5 tutorials with the highest number for field hits.. My currently php code PHP: $gethottuts = mysql_query("SELECT * from tutorials ORDER BY hits ASC LIMIT 5"); Any ideas? iNod
U user-7256 VIP Member VIP โ 20 โ Impact 111 Aug 25, 2005 #2 Ideas for what? EDIT: For the highest number of hits to be pulled out first, you want DESC.
iNod Eating PieVIP Member VIP โ 20 โ Impact 66 Aug 25, 2005 #3 That still doesn't work Look here http://www.flubel.vphost.net/tutorialboard/index.php Notice views is hits.. So shouldn't the 38 be above the 30..etc iNod
That still doesn't work Look here http://www.flubel.vphost.net/tutorialboard/index.php Notice views is hits.. So shouldn't the 38 be above the 30..etc iNod
U user-7256 VIP Member VIP โ 20 โ Impact 111 Aug 25, 2005 #4 Uh.... that should work... make sure your table data is right...?
iNod Eating PieVIP Member VIP โ 20 โ Impact 66 Aug 25, 2005 #5 Ah I got it.. I was varchar for some reason.. Changed back to bigint.. iNod
U user-7256 VIP Member VIP โ 20 โ Impact 111 Aug 26, 2005 #7 Yes of course it does... since he fixed it...