Unstoppable Domains โ€” AI Assistant

Mysql display top 5 greatest values for hits

Spaceship Spaceship
Watch

iNod

Eating PieVIP Member
Impact
66
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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
Ideas for what?

EDIT: For the highest number of hits to be pulled out first, you want DESC.
 
0
•••
0
•••
:guilty:

Uh.... that should work... make sure your table data is right...?
 
0
•••
Ah I got it..

I was varchar for some reason.. Changed back to bigint..

iNod
 
0
•••
Works fine for me.
 
0
•••
Yes of course it does... since he fixed it...
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back